mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
Route类的after_behavior行为支持 多个行为执行
This commit is contained in:
@@ -926,7 +926,13 @@ class Route
|
||||
if ($option['after_behavior'] instanceof \Closure) {
|
||||
$result = call_user_func_array($option['after_behavior'], [$route]);
|
||||
} else {
|
||||
$result = Hook::exec($option['after_behavior'], '', $route);
|
||||
$behaviors = (array)$option['after_behavior'];
|
||||
foreach($behaviors as $behavior){
|
||||
$result = Hook::exec($behavior, '', $route);
|
||||
if (!is_null($result)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 路由规则重定向
|
||||
if ($result instanceof Response) {
|
||||
|
||||
Reference in New Issue
Block a user