[建议]tp5.1路由的写法升级,支持PHPstorm查看方法是否被引用
felixwann opened this issue · 0 comments
felixwann commented
文件:thinkphp/library/think/route/Rule.php
第794行,增加这段代码:
elseif (is_array($route) && count($route) == 2) {
$result = $this->dispatchMethod($request, $route[0] . '@' . $route[1]);
}
定义路由:
Route::get('hello/:name', [\app\index\controller\Index::class, 'hello']);