首页路由与 URLRoute 三段式解析
Route 三段式解析
Kuoqi\Core\Route:module/controller/action 三段式路由解析
路由格式
/index.php/Module/Controller/Action/key1/value1/key2/value2

// 默认值:DEFAULT_MOD / DEFAULT_CTL / DEFAULT_ACT(均为 Index)
// 不足 3 段右对齐补齐:
//   user/list  → Index/User/List
//   (空)       → Index/Index/Index

解析流程(Route::request)

#步骤说明
1取 REQUEST_URI去掉 SCRIPT_NAME(如 /index.php)
2routeDecode先匹配自定义路由规则({id} → 正则),命中则参数以 参数名/值 追加
3三段拆分按 / 拆 path,不足 3 段右对齐补默认值
4额外参数第 4 段起按 key/value 成对存入 __dataer(奇数位为 key,偶数位为值,孤值置 null)
5query 汇入query 串部分经 setRoutes 汇入
典型用法
// WebCore::__initInput
$this->__route = new Core\Route(Core\Route::request());

// 访问器(code2hump 转换)
$mod = $route->getModule();      // Home
$ctl = $route->getController();  // User
$act = $route->getAction();      // List
$extra = $route->getExtra();     // array("key1"=>"value1", ...)
KuoqiPHP v1.05 · 离线静态文档 · 界面基于 KuoqiUI · 返回首页