RSS - Latest posts Redirect in controller plugin – Zend Framework 1.8

Home » 2009 » 07 » Redirect in controller plugin – Zend Framework 1.8

If you need to redirect while inside a controller plugin, for example in preDispatch() here is a quick way to do it:

$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
$redirector->gotoUrl('/login/');

 

You can leave a response, or trackback from your own site.

Add Comment

  1. Exactly what I was looking for. Cheers!

  2. matthew says:

    Not sure what’s going on exactly. I’m trying to use that, but it doesn’t redirect. It only continues to execute the current request.