mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
Route增加option参数,效果为选择所在模块
This commit is contained in:
@@ -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);
|
||||||
@@ -307,6 +308,9 @@ class Route
|
|||||||
$key = $group ? $group . ($rule ? '/' . $rule : '') : $rule;
|
$key = $group ? $group . ($rule ? '/' . $rule : '') : $rule;
|
||||||
self::name($name, [$key, $vars, self::$domain]);
|
self::name($name, [$key, $vars, self::$domain]);
|
||||||
}
|
}
|
||||||
|
if (isset($option['modular'])) {
|
||||||
|
$route = $option['modular'] . '/' . $route;
|
||||||
|
}
|
||||||
if ($group) {
|
if ($group) {
|
||||||
if ('*' != $type) {
|
if ('*' != $type) {
|
||||||
$option['method'] = $type;
|
$option['method'] = $type;
|
||||||
|
|||||||
Reference in New Issue
Block a user