mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
简化Route类的parseUrl方法 取消url_parse_type参数
This commit is contained in:
@@ -93,8 +93,6 @@ return [
|
|||||||
'url_controller_layer' => 'controller',
|
'url_controller_layer' => 'controller',
|
||||||
// 表单请求类型伪装变量
|
// 表单请求类型伪装变量
|
||||||
'var_method' => '_method',
|
'var_method' => '_method',
|
||||||
// URL解析方式 module controller class namespace
|
|
||||||
'url_parse_type' => 'module',
|
|
||||||
|
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 模板引擎设置
|
// | 模板引擎设置
|
||||||
|
|||||||
@@ -468,7 +468,7 @@ class App
|
|||||||
}
|
}
|
||||||
if (false === $result) {
|
if (false === $result) {
|
||||||
// 路由无效 解析模块/控制器/操作/参数... 支持控制器自动搜索
|
// 路由无效 解析模块/控制器/操作/参数... 支持控制器自动搜索
|
||||||
$result = Route::parseUrl($path, $depr, $config['controller_auto_search'], $config['url_param_type'], $config['url_parse_type']);
|
$result = Route::parseUrl($path, $depr, $config['controller_auto_search']);
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -931,8 +931,8 @@ class Route
|
|||||||
* 检测路由规则
|
* 检测路由规则
|
||||||
* @access private
|
* @access private
|
||||||
* @param string $rule 路由规则
|
* @param string $rule 路由规则
|
||||||
* @param string $url URL地址
|
|
||||||
* @param string $route 路由地址
|
* @param string $route 路由地址
|
||||||
|
* @param string $url URL地址
|
||||||
* @param array $pattern 变量规则
|
* @param array $pattern 变量规则
|
||||||
* @param array $option 路由参数
|
* @param array $option 路由参数
|
||||||
* @return array|false
|
* @return array|false
|
||||||
@@ -1002,11 +1002,9 @@ class Route
|
|||||||
* @param string $url URL地址
|
* @param string $url URL地址
|
||||||
* @param string $depr URL分隔符
|
* @param string $depr URL分隔符
|
||||||
* @param bool $autoSearch 是否自动深度搜索控制器
|
* @param bool $autoSearch 是否自动深度搜索控制器
|
||||||
* @param integer $paramType URL参数解析方式 0 名称解析 1 顺序解析
|
|
||||||
* @param string $type 路由类型
|
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function parseUrl($url, $depr = '/', $autoSearch = false, $paramType = 0, $type = 'module')
|
public static function parseUrl($url, $depr = '/', $autoSearch = false)
|
||||||
{
|
{
|
||||||
if (isset(self::$bind['module'])) {
|
if (isset(self::$bind['module'])) {
|
||||||
// 如果有模块/控制器绑定
|
// 如果有模块/控制器绑定
|
||||||
@@ -1047,7 +1045,7 @@ class Route
|
|||||||
// 封装路由
|
// 封装路由
|
||||||
$route = [$module, $controller, $action];
|
$route = [$module, $controller, $action];
|
||||||
}
|
}
|
||||||
return ['type' => $type, $type => $route];
|
return ['type' => 'module', 'module' => $route];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user