From c7a7c1a1380fc91c563e52f400e4a15531e13eb2 Mon Sep 17 00:00:00 2001 From: cnbailian Date: Tue, 10 Jan 2017 15:25:56 +0800 Subject: [PATCH] =?UTF-8?q?Route=E5=A2=9E=E5=8A=A0option=E5=8F=82=E6=95=B0?= =?UTF-8?q?,=E6=95=88=E6=9E=9C=E4=B8=BA=E9=80=89=E6=8B=A9=E6=89=80?= =?UTF-8?q?=E5=9C=A8=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/think/Route.php b/library/think/Route.php index 205999a5..5a4a1f42 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -232,6 +232,7 @@ class Route public static function rule($rule, $route = '', $type = '*', $option = [], $pattern = []) { $group = self::getGroup('name'); + if (!is_null($group)) { // 路由分组 $option = array_merge(self::getGroup('option'), $option); @@ -307,6 +308,9 @@ class Route $key = $group ? $group . ($rule ? '/' . $rule : '') : $rule; self::name($name, [$key, $vars, self::$domain]); } + if (isset($option['modular'])) { + $route = $option['modular'] . '/' . $route; + } if ($group) { if ('*' != $type) { $option['method'] = $type;