Search code examples
phpzend-frameworkzend-framework-mvc

How do I pass a URL as a parameter of an URL in Zend Framework?


My question spawns from me sending an email to the user with something like the following:

http://mydomain.net/login/index/dest/%2Finvitation%2Fconfirm%2Fconfirmation_key%2F15116b5e4c61e4111ade679c10b3bf27

As you can see, what I'm trying to do is pass a url as the parameter "dest" so that the login page will know where to redirect after the user logs in. However, I'm presented with the following:

404 Not Found - /login/index/dest//invitation/confirm/confirmation_key/15116b5e4c61e4111ade679c10b3bf27

This is the View I use to create the email:

<p>
<?if($this->invitation->user):?>
<a href='<?=$this->serverUrl($this->baseUrl().$this->url(array(
    'action'=>'index',
    'controller'=>'login',
    'dest'=>$this->url(array(
        'action'=>'confirm',
        'controller'=>'invitation',
        'confirmation_key'=>$this->invitation->confirmation_key
    ))
)));?>'>Log in to confirm this invitation.</a>

//The view continues...

Any idea on how to keep this from translating the URI encoded items to their literal value would be greatly appreciated.


Solution

  • Can't you just send it over as a simpel GET parameter?

    Like http://mydomain.net/login/index/?redirect=/invitation/confirm/confirmation_key/15116b5e4c61e4111ade679c10b3bf27

    That's how it's mostly done actually.