The url helper remembers the current router and parameters passed to the
request, therefore you need to specify the router name and to reset the
parameters. You can achieve that this way:

    $this->url(array('module' => 'default', 'controller' => 'login',
'action' => 'index')), 'default', true);

this will tell the helper to use the default router and to forget the
current parameters.

Hope it works ;)

Giuliano

MrBrightside wrote:
> 
> hi,
> 
> I am having a problem with generating Urls using the URL view helper, on a
> page which is using the router.
> 
> I have a router setup as this:
> $router->addRoute('profile',new
> Zend_Controller_Router_Route('profile/:username',array('module'=>'default','controller'
> => 'profile','action' => 'index')));
> This means that visiting:
> http://mysite/profile/anyusername
> Will work the same as:
> http://mysite/profile/index/username/anyusername
> I have tested this and it works fine.
> 
> The problem I have is that any url generated with the url view helper on
> that page e.g.
> $this->url(array('module'=>'default','controller'=>'login','action'=>'index');
> Will not work, and the url I get instead is:
> http://mysite/profile/anyusername
> 
> Please can someone help with this issue.
> Thanks in advance
> 

-- 
View this message in context: 
http://www.nabble.com/Url-Helper-on-Routed-Page-tp21416339p21431529.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to