改进Request的动态方法调用 自动注入当前request对象

This commit is contained in:
thinkphp
2016-06-20 11:48:47 +08:00
parent 5618c367bf
commit eca38db038

View File

@@ -131,6 +131,7 @@ class Request
public function __call($method, $args)
{
if (array_key_exists($method, self::$hook)) {
array_unshift($args, $this);
call_user_func_array(self::$hook[$method], $args);
} else {
throw new Exception('method not exists:' . __CLASS__ . '->' . $method);