mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
增加路由开关url_route_on
路由参数改为url_route_rules
This commit is contained in:
@@ -254,12 +254,15 @@ class App
|
|||||||
throw new Exception('URL_SUFFIX_DENY');
|
throw new Exception('URL_SUFFIX_DENY');
|
||||||
}
|
}
|
||||||
// 路由检测
|
// 路由检测
|
||||||
Route::register($config['routes']);
|
if (!empty($config['url_route_on'])) {
|
||||||
Route::check($_SERVER['PATH_INFO'], $config['pathinfo_depr']);
|
// 开启路由 则检测路由配置 并默认读取 url_route_rules 参数
|
||||||
|
Route::register($config['url_route_rules']);
|
||||||
|
Route::check($_SERVER['PATH_INFO'], $config['pathinfo_depr']);
|
||||||
|
}
|
||||||
|
|
||||||
// 获取URL中的模块名
|
// 获取URL中的模块名
|
||||||
if ($config['require_module'] && !isset($_GET[VAR_MODULE])) {
|
if ($config['require_module'] && !isset($_GET[VAR_MODULE])) {
|
||||||
$paths = explode($config['pathinfo_depr'], __INFO__, 2);
|
$paths = explode($config['pathinfo_depr'], __INFO__, 2);
|
||||||
$_GET[VAR_MODULE] = array_shift($paths);
|
$_GET[VAR_MODULE] = array_shift($paths);
|
||||||
$_SERVER['PATH_INFO'] = implode('/', $paths);
|
$_SERVER['PATH_INFO'] = implode('/', $paths);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user