Sometimes, you will need simple url map:
For example:
/help
/aboutus
/contactus
...

So, how to map these url to your controller action?
The answer is use Zend_Controller_Router_Route_Static

Here's an example:

put these code in your appliction/Bootstrap.php

protected function _initRoutes()
{
    $front = Zend_Controller_Front::getInstance();

    $router = $front->getRouter();

    $route = new Zend_Controller_Router_Route_Static(
        'aboutus',
        array('module' => 'default',
              'controller' => 'index',
              'action' => 'aboutus')
    );
    $router->addRoute('aboutus', $route);

}

That's all, try http://yourhost/aboutus



Date: 2012-01-16 08:21:51 and last modified: 2012-01-16 08:26:49

Relate tags:

Hot tags: