Reputation: 5621
I've been using Zend framework some time now, but I'm facing a problem I can't solve myself. I'm using Zend_Layout, Zend_View and the URL view helper to create hyperlinks. To create some SEO-friendly URL's, I use the following code in my layout.phtml:
<?php echo $this->url( array( 'module' => 'default', 'controller' => 'contact' ), 'contact', true ); ?>
This works fine. The link is contact.html (this is dealt with in my bootstrap). But when I try to access a different page which is not routed (backend pages don't need to have SEO-URL's) after I visit the contact page, Zend automatically uses the current route. To make things clearer, the code I use to create a link to a backend page in my layout.phtml:
<?php echo $this->url( array( 'module' => 'admin', 'controller' => 'manage' ), null, true ); ?>
The second parameter, null, is used to tell the helper that no route is used for this link. But it seems that Zend automatically uses the current route (the contact route). How to solve this problem?
Thanks in advance!
Upvotes: 3
Views: 4453
Reputation: 106402
Use 'default'
as the route parameter. null
tells the URL view helper to use the current route not, as you thought, no route
Upvotes: 7