改进App类invokeMethod方法

This commit is contained in:
thinkphp
2016-11-29 15:15:43 +08:00
parent fedfd9c857
commit da3f737ccc

View File

@@ -222,7 +222,7 @@ class App
public static function invokeMethod($method, $vars = []) public static function invokeMethod($method, $vars = [])
{ {
if (is_array($method)) { if (is_array($method)) {
$class = is_object($method[0]) ? $method[0] : new $method[0](Request::instance()); $class = is_object($method[0]) ? $method[0] : self::invokeClass($method[0]);
$reflect = new \ReflectionMethod($class, $method[1]); $reflect = new \ReflectionMethod($class, $method[1]);
} else { } else {
// 静态方法 // 静态方法