From 744fa08329a00d06248462e4c493585270e8d7b4 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 16 Jun 2016 16:43:21 +0800 Subject: [PATCH] =?UTF-8?q?Route=E7=B1=BB=E7=9A=84after=5Fbehavior?= =?UTF-8?q?=E8=A1=8C=E4=B8=BA=E6=94=AF=E6=8C=81=20=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E8=A1=8C=E4=B8=BA=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/think/Route.php b/library/think/Route.php index 68486461..6cb9c265 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -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) {