ZF: Url View Helper Acting Strangely
Posted
by
moteutsch
on Stack Overflow
See other posts from Stack Overflow
or by moteutsch
Published on 2011-09-04T12:36:21Z
Indexed on
2012/09/16
21:38 UTC
Read the original article
Hit count: 180
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?
© Stack Overflow or respective owner