改进Route类

This commit is contained in:
thinkphp
2016-05-24 18:30:23 +08:00
parent 901631b8d5
commit 200e51c3b1

View File

@@ -401,7 +401,7 @@ class Route
if (strpos($val[1], ':id') && isset($option['var'][$rule])) {
$val[1] = str_replace(':id', ':' . $option['var'][$rule], $val[1]);
}
$rule = $rule . $val[1];
$rule = ltrim($rule . $val[1], '/');
self::rule($rule ? $rule . '$' : '', $route . '/' . $val[2], $val[0], $option, $pattern);
}
}