I'm having an issue with my routes.
So let's say I have the TestController with the action edit, that gets a parameter named as 'name'.
The access url would be test.com/test/edit/name/randomname.
I wanted to make it so it could be accessed by test.com/test/edit/randomname, so I added this in the function _initRoutes in Bootstrap.
$router = Zend_Controller_Front::getInstance()->getRouter();
$route = new Zend_Controller_Router_Route(
'test/edit/:name',
array('controller' => 'test', 'action' => 'edit', 'name' => 'Default'));
$router->addRoute('edit-test', $route);
So it works as I want it to, but another issue occurred. I have a link in the layout.phtml which is something like
<a href="<?php echo $this->url(array('controller' =>'account','action'=>'logout'));?>">Logout</a>
The problem is that when i navigate to test.com/test/edit/randomname, the link above for some weird reason changes and points to the same url as above, ie test.com/test/edit/randomname.
What's going wrong?
Note: Im using modules, the TestController is in the default module.