I have a problem in my current Zend Framework application.
In my Bootstrap, I register these routes:
protected function _initRouter() { $this->bootstrap("FrontController"); $frontController = $this->getResource("FrontController"); $route = new Zend_Controller_Router_Route( ":module/:id", array( "controller" => "index", "action" => "index" ), array("id" => "\d+") ); $frontController->getRouter()->addRoute('shortcutOne', $route); $route = new Zend_Controller_Router_Route( ":module/:controller/:id", array("action" => "index"), array("id" => "\d+") ); $frontController->getRouter()->addRoute('shortcutTwo', $route); $route = new Zend_Controller_Router_Route( ":module/:controller/:action/:id", null, array("id" => "\d+", "action" => "\w+") ); $frontController->getRouter()->addRoute('shortcutThree', $route); }
Now I have added Zend_Navigation to my project. I have several modules that register navigation elements in the module bootstrap:
<?php class Contact_Bootstrap extends Zend_Application_Module_Bootstrap { protected function _initNavigation() { $layout = $this->getApplication()->getResource("layout"); $view = $layout->getView(); $config = new Zend_Config_Xml(dirname(__FILE__)."/config/navigation.xml", "nav"); $view->navigation()->addPage($config); } }
When I open the application in my browser, everything works fine. This means that I see the navigation and click on its links to view the specified page. But when I click on the page using the route: module /: action /: id, the Navigation Helper throws a Zend_Controller_Router_Route exception:
Fatal error: Zend_Controller_Router_Exception: id not specified in C: \ Entwicklung \ kt \ trunk \ src \ library \ Zend \ View \ Helper \ Navigation \ HelperAbstract.php on line 519
Have any of you experienced this error too? It would be great if you could help me or give me advice. Also, if you need more information about my setup, etc., just tell me.
Thanks!