Skip to content

Commit

Permalink
改进路由到类的静态方法
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Jun 26, 2020
1 parent eaf6e6d commit b4046fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/think/route/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,9 @@ protected function dispatch(Request $request, $route, array $option): Dispatch
} elseif ($route instanceof Closure) {
// 执行闭包
$result = new CallbackDispatch($request, $this, $route, $this->vars);
} elseif (false !== strpos($route, '@')) {
} elseif (false !== strpos($route, '@') || false !== strpos($route, '::')) {
// 路由到类的方法
$route = str_replace('::', '@', $route);
$result = $this->dispatchMethod($request, $route);
} else {
// 路由到控制器/操作
Expand Down

0 comments on commit b4046fb

Please sign in to comment.