首页›路由与 URL›Route 方法族
Route 方法族
Route 实例的路径操作与输出方法
方法清单
| 方法 | 签名 | 说明 |
|---|---|---|
__construct | ($input="") | 解析路径 |
setPath | setPath($path) | 重新解析路径 |
setRoute | setRoute($name,$value) | 设置段:m/c/a 特判,其余进 __dataer |
setRoutes | setRoutes($routes) | 批量设置(支持 query 字符串) |
getModule | getModule($ishump=true) | 模块名(code2hump) |
getController | getController($ishump=true) | 控制器名 |
getAction | getAction($ishump=true) | 动作名 |
getExtra | getExtra() | 额外参数数组 |
getPath | getPath($withHump=false) | "/mod/ctl/act" 路径 |
getPathDeep | getPathDeep($deep=0) | 从 deep 起的路径(hump2code 小写) |
toArray / toUrl | toArray() / toUrl() | 数组形式 / URL 形式 |
典型用法
// Url 类内部使用示例
$route = new Route("/Home/Goods/Detail");
$route->setPath($this->__path);
$route->setRoutes($this->__querys);
$url = $route->getPathDeep() . "?" . $route->toUrl();
KuoqiPHP v1.05 · 离线静态文档 · 界面基于 KuoqiUI ·
返回首页