From 390077500d097310910722df6099f4e49919645a Mon Sep 17 00:00:00 2001 From: cnbailian Date: Tue, 10 Jan 2017 11:07:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96Router=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=20=E9=A1=BA=E4=BE=BF=E9=97=AE=E4=B8=80=E4=B8=8B,url=E4=B8=AD?= =?UTF-8?q?=E9=9D=99=E6=80=81=E5=8F=98=E9=87=8F=E6=98=AF=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E5=9C=A8=E6=B2=A1=E6=9C=89=E8=AE=BE=E7=BD=AEmerge=5Fextra=5Fva?= =?UTF-8?q?rs=E6=97=B6=E5=BA=94=E8=AF=A5=E4=B8=8D=E5=8F=AF=E7=94=A8,?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E5=BA=94=E8=AF=A5=E5=88=A4=E6=96=AD=E4=B8=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/Route.php b/library/think/Route.php index 4f08e911..205999a5 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -1164,7 +1164,7 @@ class Route $len1 = substr_count($url, '|'); $len2 = substr_count($rule, '/'); // 多余参数是否合并 - $merge = !empty($option['merge_extra_vars']) ? true : false; + $merge = !empty($option['merge_extra_vars']); if ($merge && $len1 > $len2) { $url = str_replace('|', $depr, $url); $url = implode('|', explode($depr, $url, $len2 + 1)); From c7a7c1a1380fc91c563e52f400e4a15531e13eb2 Mon Sep 17 00:00:00 2001 From: cnbailian Date: Tue, 10 Jan 2017 15:25:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Route=E5=A2=9E=E5=8A=A0option=E5=8F=82?= =?UTF-8?q?=E6=95=B0,=E6=95=88=E6=9E=9C=E4=B8=BA=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=89=80=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;