mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
改进路由到类的方法的地址写法
This commit is contained in:
@@ -1041,7 +1041,8 @@ class Route
|
||||
$result = ['type' => 'redirect', 'url' => $url, 'status' => (is_array($route) && isset($route[1])) ? $route[1] : 301];
|
||||
} elseif (0 === strpos($url, '\\')) {
|
||||
// 路由到方法
|
||||
$result = ['type' => 'method', 'method' => is_array($route) ? [$url, $route[1]] : $url, 'params' => $matches];
|
||||
$method = strpos($url, '@') ? explode('@', $url) : $url;
|
||||
$result = ['type' => 'method', 'method' => $method, 'params' => $matches];
|
||||
} elseif (0 === strpos($url, '@')) {
|
||||
// 路由到控制器
|
||||
$result = ['type' => 'controller', 'controller' => substr($url, 1), 'params' => $matches];
|
||||
|
||||
Reference in New Issue
Block a user