mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
优化代码
This commit is contained in:
@@ -355,6 +355,7 @@ class Route
|
|||||||
self::$rules['*'][$name]['pattern'] = $pattern;
|
self::$rules['*'][$name]['pattern'] = $pattern;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$item = [];
|
||||||
foreach ($routes as $key => $val) {
|
foreach ($routes as $key => $val) {
|
||||||
if (is_numeric($key)) {
|
if (is_numeric($key)) {
|
||||||
$key = array_shift($val);
|
$key = array_shift($val);
|
||||||
@@ -380,8 +381,7 @@ class Route
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} elseif ($routes instanceof \Closure) {
|
||||||
if ($routes instanceof \Closure) {
|
|
||||||
// 闭包注册
|
// 闭包注册
|
||||||
$currentOption = self::getGroup('option');
|
$currentOption = self::getGroup('option');
|
||||||
$currentPattern = self::getGroup('pattern');
|
$currentPattern = self::getGroup('pattern');
|
||||||
@@ -393,7 +393,6 @@ class Route
|
|||||||
self::rule($routes, '', '*', $option, $pattern);
|
self::rule($routes, '', '*', $option, $pattern);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册路由
|
* 注册路由
|
||||||
|
|||||||
Reference in New Issue
Block a user