简介:这是关于goto------zf学习笔记(11/08/06 12:07)的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。
class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=342963' scrolling='no'>前几天在项目中看到这句代码:
$this->getHelper('redirector')->goto('login', 'account');
找遍了rediretor.php 也找不到goto方法,最后发现原来是在__call中。goto原来就是gotoSimple,呵呵~~
public function __call($method, $args) { $method = strtolower($method); if ('goto' == $method) { return call_user_func_array(array($this, 'gotoSimple'), $args); } if ('setgoto' == $method) { return call_user_func_array(array($this, 'setGotoSimple'), $args); } if ('gotoandexit' == $method) { return call_user_func_array(array($this, 'gotoSimpleAndExit'), $args); } require_once 'Zend/Controller/Action/Exception.php'; throw new Zend_Controller_Action_Exception(sprintf('Invalid method "%s" called on redirector', $method)); }