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