-- Sudheer Satyanarayana <sudhee...@binaryvibes.co.in> wrote
(on Tuesday, 06 October 2009, 09:32 PM +0530):
> In my bootstrap I am adding the Zend_Rest_Route
>
> [code]
> protected function _initRestRoute()
>     {
>         if (PHP_SAPI == 'cli') {
>             return;
>         }
>
>         $this->bootstrap('frontController');
>         $frontController = Zend_Controller_Front::getInstance();
>         $restRoute = new Zend_Rest_Route($frontController, array(),  
> array('webservice'));
>         $frontController->getRouter()->addRoute('rest', $restRoute);
>
>     }
> [/code]
>
> After adding this route, the url view helper is not returning the  
> correct URL. For instance, in the layout script(default module),
>
> [code]
>  $url =  
> $this->url(array('module'=>'default','controller'=>'user','action'=>'login'));
>  echo $url;
> [/code]
>
> The url returns the value '/user' instead of '/user/login'.
>
> How can I correct this issue

There are two things going wrong: you need to specify the route, and,
specifically, the default route, when using the url() view helper.

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

-- 
Matthew Weier O'Phinney
Project Lead            | matt...@zend.com
Zend Framework          | http://framework.zend.com/

Reply via email to