mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进路由规则的组合变量定义的时候 可选分隔符的问题
支持使用 Route::rules('item-<name>(-?)<page?>','item/read');
This commit is contained in:
@@ -77,6 +77,8 @@ class Url
|
|||||||
if (!empty($rule) && $match = self::getRuleUrl($rule, $vars)) {
|
if (!empty($rule) && $match = self::getRuleUrl($rule, $vars)) {
|
||||||
// 匹配路由命名标识
|
// 匹配路由命名标识
|
||||||
$url = $match[0];
|
$url = $match[0];
|
||||||
|
// 替换可选分隔符
|
||||||
|
$url = preg_replace(['/\((\W)\?\)$/', '/\((\W)\?\)/'], ['', '\1'], $url);
|
||||||
if (!empty($match[1])) {
|
if (!empty($match[1])) {
|
||||||
$domain = $match[1];
|
$domain = $match[1];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user