优化代码

This commit is contained in:
thinkphp
2016-08-01 23:17:44 +08:00
parent 6561dcfcbb
commit b57401eb1e

View File

@@ -355,6 +355,7 @@ class Route
self::$rules['*'][$name]['pattern'] = $pattern;
}
} else {
$item = [];
foreach ($routes as $key => $val) {
if (is_numeric($key)) {
$key = array_shift($val);
@@ -380,8 +381,7 @@ class Route
}
}
} else {
if ($routes instanceof \Closure) {
} elseif ($routes instanceof \Closure) {
// 闭包注册
$currentOption = self::getGroup('option');
$currentPattern = self::getGroup('pattern');
@@ -393,7 +393,6 @@ class Route
self::rule($routes, '', '*', $option, $pattern);
}
}
}
/**
* 注册路由