Where should I define custom routes in my ZF 1.10 app?
- by Ross
With the new Zend_Application/Zend_Application_Bootstrap classes I'm confused as to where I should be applying my custom routes. For example, at the moment I have one route:
protected function _initRouter() {
$router = new Zend_Controller_Router_Rewrite;
$route = new Zend_Controller_Router_Route('news/:id',
array('controller' => 'news', 'action' => 'view'));
$router->addRoute('postArchive', $route);
}
This method is in my Zend_Application_Bootstrap_Bootstrap and is definitely run. The route is also applied in $router.
As I see it I could be doing two things wrong - either the wrong place to add these routes, or not adding to the correct router. Can anyone point me in the right direction with this?