mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
路由到方法的时候 支持实例化类注入请求对象
This commit is contained in:
@@ -214,7 +214,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];
|
$class = is_object($method[0]) ? $method[0] : new $method[0](Request::instance());
|
||||||
$reflect = new \ReflectionMethod($class, $method[1]);
|
$reflect = new \ReflectionMethod($class, $method[1]);
|
||||||
} else {
|
} else {
|
||||||
// 静态方法
|
// 静态方法
|
||||||
|
|||||||
Reference in New Issue
Block a user