I am having a similar problem.  In my controller I would like to specify a
URL.

Currently I am using: $this->view->saveUrl = $this->_baseUrl . '/save/' .
$this->_groupKey . '/' . $this->_pageTitle;

I tried the redirector approach but obviously that redirects straight away.

Is there another method to build up urls in the controller.  Much akin to
the $this->url in the view.

- Robert 

-----Original Message-----
From: Matthew Weier O'Phinney [mailto:[EMAIL PROTECTED] 
Sent: 08 July 2008 16:18
To: [email protected]
Subject: Re: [fw-general] Re: Re[fw-general] direct Question

-- monk.e.boy <[EMAIL PROTECTED]> wrote (on Tuesday, 08 July 2008,
07:36 AM -0700):
> Matthew Weier O'Phinney-3 wrote:
> > 
> > 
> > Use the redirector instead of constructing the URL yourself:
> > 
> >     $this->_helper->redirector('project');
> > 
> > This will do the same as what you were trying to accomplish before.
> > --
> > Matthew Weier O'Phinney
> > 
> > 
> 
> Matt,
> 
>   Thanks for the promp reply!
> 
>   Does the redirector act like the URL constructor? My URL looks like
this:
> 
>   /base/application/report/customer/33/project/12/report/99/
> 
> Doing this:
>   $this->_helper->redirector('report')
> 
> takes me to:
>   /base/application/report/
> 
> How do you suggest I build and pass the URL above to the redirector? 

If you want to do url()-like redirection, use the gotoRoute() method of the
redirector:

    $this->_helper->redirector->gotoRoute(array('action' => 'project'));

It takes the same arguments as the url() view helper, and builds using the
same mechanisms.

> At the
> moment I do a lot of: 
> 
> '/base/application/report/customer/'. $this->_getParam( 'customer' ) .'/'.
> $this->_getParam( 'project' ) .'/report/'. $this->_getParam( 'report' 
> )
> 
> which makes me feel icky :-(

--
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

________________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs Email
Security Service and the Macro 4 plc internal virus protection system.
________________________________________________________________________


________________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs Email 
Security Service and the Macro 4 plc internal virus protection system.
________________________________________________________________________

Reply via email to