Reputation: 23100
Is it possible to redirect a view script via using a zend method ?
Or would it just be simpler to use a php redirect: <?php header('Location: $myurl') ?>
Upvotes: 1
Views: 7847
Reputation: 13296
In your controller (use location header):
$this->_redirect($url);
or
$redirector = $this->getHelper('Redirector');
/* @var $redirector Zend_Controller_Action_Helper_Redirector */
$redirector->gotoUrl($url);
you can also use:
$redirector->gotoRoute(
array(
'action' => 'my-action',
'controller' => 'my-controller'
)
);
If you want to use a different view script than the default:
$this->renderScript('/my-controller/my-view.phtml');
Upvotes: 7