Zend redirect in a view script
Is it possible to redirect a view script via usi开发者_StackOverflowng a zend method ?
Or would it just be simpler to use a php redirect:
<?php header('Location: $myurl') ?>
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');
精彩评论