我读到过$this->getHelper('[helper_name]')比$this->_helper->[helper_name]更可取。我还没有找到关于哪一个更好/更好的文档:$this->_redirect($url)还是$this->getHelper('Redirector')->gotoUrl($url)。
发布于 2011-03-11 22:53:07
使用任何适合你的工具,它们做的都是一样的事情:
/**
* 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);
}https://stackoverflow.com/questions/5274355
复制相似问题