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
Recent entries:
- Emacs rainbow mode
- Squirm a url rewriter for squid
- How to use rsync for transferring files over ssh
- Vide: GRE tunnel
- Video: how to install freebsd
- Video: Install zend framework
- Video: Install Window7 from network
- Install Window7 from a PXE Boot server (Linux/FreeBSD)
- Create GRE tunnel with FreeBSD8
- What's cooking for FreeBSD 9