From 31aae17f55b4f69580696a881f6e783e44e4c636 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 26 Oct 2016 08:45:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BApp=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E7=A9=BA=E6=93=8D=E4=BD=9C=E6=96=B9=E6=B3=95=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/App.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/think/App.php b/library/think/App.php index 40c726c8..7feff2fe 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -377,12 +377,14 @@ class App // 获取当前操作名 $action = $actionName . $config['action_suffix']; + $vars = []; if (is_callable([$instance, $action])) { // 执行操作方法 $call = [$instance, $action]; } elseif (is_callable([$instance, '_empty'])) { // 空操作 $call = [$instance, '_empty']; + $vars = [$action]; } else { // 操作不存在 throw new HttpException(404, 'method not exists:' . get_class($instance) . '->' . $action . '()'); @@ -390,7 +392,7 @@ class App Hook::listen('action_begin', $call); - return self::invokeMethod($call); + return self::invokeMethod($call, $vars); } /**