ZF-11255: Viewing defined route overwrites existing links that use the url helper


Declaring a Route in a Bootstrap.php allows accessing a module/controller/action using a short name 'myroute'. However, when viewing the page http://localhost/project/index.php/myroute/ all urls on the page which use the url helper, except those which are also defined in a route, are replaced with the 'myroute' URL. Viewing the page normally, ie through http://localhost/project/module/controller/action/ all the links will work normally.


Create a new project. Add the Zend Framework library. Replace the /application folder with the contents of the zip file. The only files changed from the default are Bootstrap.php and the view script for the index controller, index action

Duplicate of http://framework.zend.com/issues/browse/ZF-6486

The current behavior is not clear in the documentation. If you use any routes in your application all calls to the url helper must be changed to the following: $this->view->url(array('module' => 'account', 'controller' => 'index', 'action' => 'login'), 'default', false);

from this: $this->view->url(array('module' => 'account', 'controller' => 'index', 'action' => 'login'), null, false);

as the expectation changes from null being the defined default route to the explicit 'default'.

Duplicate / Not an issue

No fix version for a duplicate issue not resolved