4

私はそれ$this->getHelper('[helper_name]')がより好ましいと読んだ$this->_helper->[helper_name]。私がドキュメントを見つけることができなかったのは、これらのどちらがより優れている/優先されているかです:$this->_redirect($url)または$this->getHelper('Redirector')->gotoUrl($url).

4

1 に答える 1

5

自分に合ったものを使用してください。まったく同じことを行います。

/**
 * 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);
}
于 2011-03-11T14:53:07.270 に答える