mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
增加route_complete_match配置参数设置全局路由规则定义是否采用完整匹配 可以由路由规则的参数complete_match 进行覆盖
This commit is contained in:
@@ -284,10 +284,14 @@ class Route
|
|||||||
} elseif (is_string($route)) {
|
} elseif (is_string($route)) {
|
||||||
$name = $route;
|
$name = $route;
|
||||||
}
|
}
|
||||||
if ('$' == substr($rule, -1, 1)) {
|
if (!isset($option['complete_match'])) {
|
||||||
// 是否完整匹配
|
if (Config::get('route_complete_match')) {
|
||||||
$option['complete_match'] = true;
|
$option['complete_match'] = true;
|
||||||
$rule = substr($rule, 0, -1);
|
} elseif ('$' == substr($rule, -1, 1)) {
|
||||||
|
// 是否完整匹配
|
||||||
|
$option['complete_match'] = true;
|
||||||
|
$rule = substr($rule, 0, -1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ('/' != $rule) {
|
if ('/' != $rule) {
|
||||||
$rule = trim($rule, '/');
|
$rule = trim($rule, '/');
|
||||||
|
|||||||
Reference in New Issue
Block a user