Think\Route类改进 增加add等方法用于注册路由规则 并添加请求类型支持 路由规则支持闭包

This commit is contained in:
thinkphp
2013-03-25 14:37:02 +08:00
parent 3a77fd3a23
commit a28899656b
2 changed files with 68 additions and 5 deletions

View File

@@ -247,8 +247,7 @@ class App {
Tag::listen('path_info');
$url = trim(substr_replace($_SERVER['PATH_INFO'],'',0,strlen($_GET[$var_m])+1),'/');
// 模块路由检测
if(!$config['url_route'] || !Route::check($url,$config['url_route_rules'])){
// PATHINFO URL规则 默认为 Controller/Action/
if(!$config['url_route'] || !Route::check($url)){
$paths = explode($config['pathinfo_depr'],$url);
if($config['require_controller'] && !isset($_GET[$var_c])) {
$_GET[$var_c] = array_shift($paths);