mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
改进Request的动态方法调用 自动注入当前request对象
This commit is contained in:
@@ -131,6 +131,7 @@ class Request
|
|||||||
public function __call($method, $args)
|
public function __call($method, $args)
|
||||||
{
|
{
|
||||||
if (array_key_exists($method, self::$hook)) {
|
if (array_key_exists($method, self::$hook)) {
|
||||||
|
array_unshift($args, $this);
|
||||||
call_user_func_array(self::$hook[$method], $args);
|
call_user_func_array(self::$hook[$method], $args);
|
||||||
} else {
|
} else {
|
||||||
throw new Exception('method not exists:' . __CLASS__ . '->' . $method);
|
throw new Exception('method not exists:' . __CLASS__ . '->' . $method);
|
||||||
|
|||||||
Reference in New Issue
Block a user