修正Route类的group方法 混合使用闭包和数组后的bug 改进单元测试

This commit is contained in:
thinkphp
2016-07-31 13:06:12 +08:00
parent 01fc6eda1c
commit d8a5906e9c
2 changed files with 44 additions and 7 deletions

View File

@@ -334,11 +334,12 @@ class Route
}
if (!empty($name)) {
// 分组
$currentGroup = self::getGroup('name');
if ($currentGroup) {
$name = $currentGroup . '/' . ltrim($name, '/');
}
if ($routes instanceof \Closure) {
$currentGroup = self::getGroup('name');
if ($currentGroup) {
$name = $currentGroup . '/' . ltrim($name, '/');
}
$currentOption = self::getGroup('option');
$currentPattern = self::getGroup('pattern');
self::setGroup($name, $option, $pattern);