$rules
$rules :
__construct(\think\Route $router, \think\route\RuleGroup $group = null, string $name = '', string $route = '', array $option = array(), array $pattern = array(), array $rest = array())
架构函数
\think\Route | $router | 路由对象 |
\think\route\RuleGroup | $group | 路由所属分组对象 |
string | $name | 资源名称 |
string | $route | 路由地址 |
array | $option | 路由参数 |
array | $pattern | 变量规则 |
array | $rest | 资源定义 |
check(\think\route\Request $request, string $url, string $depr = '/', boolean $completeMatch = false) : \think\route\Dispatch
检测分组路由
\think\route\Request | $request | 请求对象 |
string | $url | 访问地址 |
string | $depr | 路径分隔符 |
boolean | $completeMatch | 路由是否完全匹配 |
setAutoRule(\think\route\RuleItem $rule) : $this
设置自动路由
\think\route\RuleItem | $rule | 路由规则 |
setMissRule(\think\route\RuleItem $rule) : $this
设置为MISS路由
\think\route\RuleItem | $rule | 路由规则 |
addRule(\think\route\Rule $rule, string $method = '*') : $this
添加分组下的路由规则或者子分组
\think\route\Rule | $rule | 路由规则 |
string | $method | 请求类型 |
parseRule(\think\Request $request, string $rule, string $route, string $url, array $option = array(), array $matches = array()) : \think\route\Dispatch
解析匹配到的规则路由
\think\Request | $request | 请求对象 |
string | $rule | 路由规则 |
string | $route | 路由地址 |
string | $url | URL地址 |
array | $option | 路由参数 |
array | $matches | 匹配的变量 |
checkCrossDomain(\think\Request $request) : \think\route\Dispatch|void
检查OPTIONS请求
\think\Request | $request |
parseRequestCache(\think\Request $request, string|array $cache) : void
处理路由请求缓存
\think\Request | $request | 请求对象 |
string|array | $cache | 路由缓存 |
autoValidate(array $option, \think\Request $request) : void
验证数据
array | $option | |
\think\Request | $request |
dispatch(\think\Request $request, mixed $route, array $option) : \think\route\Dispatch
发起路由调度
\think\Request | $request | Request对象 |
mixed | $route | 路由地址 |
array | $option | 路由参数 |
checkOption(array $option, \think\Request $request) : boolean
路由检查
array | $option | 路由参数 |
\think\Request | $request | Request对象 |