Son*_*nny 4 redirect zend-framework zend-controller
我读过这个$this->getHelper('[helper_name]')比较好$this->_helper->[helper_name].我无法找到任何文件是哪些更好/首选:$this->_redirect($url)或$this->getHelper('Redirector')->gotoUrl($url).
使用任何适合你的人,他们做同样的事情:
/**
* Redirect to another URL
*
* Proxies to {@link Zend_Controller_Action_Helper_Redirector::gotoUrl()}.
*
* @param string $url
* @param array $options Options to be used when redirecting
* @return void
*/
protected function _redirect($url, array $options = array())
{
$this->_helper->redirector->gotoUrl($url, $options);
}
Run Code Online (Sandbox Code Playgroud)