mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
@@ -232,6 +232,7 @@ class Route
|
|||||||
public static function rule($rule, $route = '', $type = '*', $option = [], $pattern = [])
|
public static function rule($rule, $route = '', $type = '*', $option = [], $pattern = [])
|
||||||
{
|
{
|
||||||
$group = self::getGroup('name');
|
$group = self::getGroup('name');
|
||||||
|
|
||||||
if (!is_null($group)) {
|
if (!is_null($group)) {
|
||||||
// 路由分组
|
// 路由分组
|
||||||
$option = array_merge(self::getGroup('option'), $option);
|
$option = array_merge(self::getGroup('option'), $option);
|
||||||
@@ -308,6 +309,9 @@ class Route
|
|||||||
$suffix = isset($option['ext']) ? $option['ext'] : null;
|
$suffix = isset($option['ext']) ? $option['ext'] : null;
|
||||||
self::name($name, [$key, $vars, self::$domain, $suffix]);
|
self::name($name, [$key, $vars, self::$domain, $suffix]);
|
||||||
}
|
}
|
||||||
|
if (isset($option['modular'])) {
|
||||||
|
$route = $option['modular'] . '/' . $route;
|
||||||
|
}
|
||||||
if ($group) {
|
if ($group) {
|
||||||
if ('*' != $type) {
|
if ('*' != $type) {
|
||||||
$option['method'] = $type;
|
$option['method'] = $type;
|
||||||
@@ -1166,7 +1170,7 @@ class Route
|
|||||||
$len1 = substr_count($url, '|');
|
$len1 = substr_count($url, '|');
|
||||||
$len2 = substr_count($rule, '/');
|
$len2 = substr_count($rule, '/');
|
||||||
// 多余参数是否合并
|
// 多余参数是否合并
|
||||||
$merge = !empty($option['merge_extra_vars']) ? true : false;
|
$merge = !empty($option['merge_extra_vars']);
|
||||||
if ($merge && $len1 > $len2) {
|
if ($merge && $len1 > $len2) {
|
||||||
$url = str_replace('|', $depr, $url);
|
$url = str_replace('|', $depr, $url);
|
||||||
$url = implode('|', explode($depr, $url, $len2 + 1));
|
$url = implode('|', explode($depr, $url, $len2 + 1));
|
||||||
|
|||||||
Reference in New Issue
Block a user