mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
改进Url类对url_convert配置的支持
This commit is contained in:
@@ -210,17 +210,21 @@ class Url
|
|||||||
}
|
}
|
||||||
$module = $module ? $module . '/' : '';
|
$module = $module ? $module . '/' : '';
|
||||||
|
|
||||||
$controller = Loader::parseName($request->controller());
|
$controller = $request->controller();
|
||||||
if ('' == $url) {
|
if ('' == $url) {
|
||||||
// 空字符串输出当前的 模块/控制器/操作
|
// 空字符串输出当前的 模块/控制器/操作
|
||||||
$url = $module . $controller . '/' . $request->action();
|
$action = $request->action();
|
||||||
} else {
|
} else {
|
||||||
$path = explode('/', $url);
|
$path = explode('/', $url);
|
||||||
$action = Config::get('url_convert') ? strtolower(array_pop($path)) : array_pop($path);
|
$action = array_pop($path);
|
||||||
$controller = empty($path) ? $controller : (Config::get('url_convert') ? Loader::parseName(array_pop($path)) : array_pop($path));
|
$controller = empty($path) ? $controller : array_pop($path);
|
||||||
$module = empty($path) ? $module : array_pop($path) . '/';
|
$module = empty($path) ? $module : array_pop($path) . '/';
|
||||||
$url = $module . $controller . '/' . $action;
|
|
||||||
}
|
}
|
||||||
|
if (Config::get('url_convert')) {
|
||||||
|
$action = strtolower($action);
|
||||||
|
$controller = Loader::parseName($controller);
|
||||||
|
}
|
||||||
|
$url = $module . $controller . '/' . $action;
|
||||||
}
|
}
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user