mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
改进url操作方法的自动转换
This commit is contained in:
@@ -1506,7 +1506,7 @@ class Route
|
||||
App::$modulePath = APP_PATH . (Config::get('app_multi_module') ? $request->module() . DS : '');
|
||||
} else {
|
||||
// 路由到模块/控制器/操作
|
||||
$result = self::parseModule($route);
|
||||
$result = self::parseModule($route, isset($option['convert']) ? $option['convert'] : false);
|
||||
}
|
||||
// 开启请求缓存
|
||||
if ($request->isGet() && isset($option['cache'])) {
|
||||
@@ -1529,7 +1529,7 @@ class Route
|
||||
* @param string $url URL地址
|
||||
* @return array
|
||||
*/
|
||||
private static function parseModule($url)
|
||||
private static function parseModule($url, $convert = false)
|
||||
{
|
||||
list($path, $var) = self::parseUrlPath($url);
|
||||
$action = array_pop($path);
|
||||
@@ -1543,7 +1543,7 @@ class Route
|
||||
// 设置当前请求的路由变量
|
||||
Request::instance()->route($var);
|
||||
// 路由到模块/控制器/操作
|
||||
return ['type' => 'module', 'module' => [$module, $controller, $action], 'convert' => false];
|
||||
return ['type' => 'module', 'module' => [$module, $controller, $action], 'convert' => $convert];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user