Reputation: 3831
I have the following route defined:
$route = new Zend_Controller_Router_Route(
'users/:id',
array(
'controller' => 'users',
'action' => 'profile',
'id' => ''
)
);
When I am on the page via the shortened URL (localhost/users/someuser), the URLs defined in the layout file all link to "localhost/users". Here is the code in the layout:
<li><a href="<?php echo $this->url(array('controller' => 'index'), null, true); ?>">Home</a></li>
<li><a href="<?php echo $this->url(array('controller' => 'search'), null, true); ?>">Search</a></li>
<!-- etc. -->
How can I fix the code so that the links in the layout file point to the correct URLs?
Upvotes: 1
Views: 160
Reputation: 43243
You should define the route you want to use when calling the helper, as otherwise it will use the current route, which is your users/:id
one. I'm assuming in the case of the two examples you give, it would be 'default'
. Try replacing null
in the the helper call with it.
Upvotes: 2