$name
$name :
check(\think\route\Request $request, string $url, string $depr = '/', boolean $completeMatch = false) : \think\route\Dispatch|false
检测路由(含路由匹配)
\think\route\Request | $request | 请求对象 |
string | $url | 访问地址 |
string | $depr | 路径分隔符 |
boolean | $completeMatch | 路由是否完全匹配 |
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 | 匹配的变量 |
__construct(\think\Route $router, \think\route\RuleGroup $parent, string $name, string|array $rule, string|\Closure $route, string $method = '*', array $option = array(), array $pattern = array())
架构函数
\think\Route | $router | 路由实例 |
\think\route\RuleGroup | $parent | 上级对象 |
string | $name | 路由标识 |
string|array | $rule | 路由规则 |
string|\Closure | $route | 路由地址 |
string | $method | 请求类型 |
array | $option | 路由参数 |
array | $pattern | 变量规则 |
checkRule(\think\route\Request $request, string $url, array $match = null, string $depr = '/', boolean $completeMatch = false) : \think\route\Dispatch|false
检测路由
\think\route\Request | $request | 请求对象 |
string | $url | 访问地址 |
array | $match | 匹配路由变量 |
string | $depr | 路径分隔符 |
boolean | $completeMatch | 路由是否完全匹配 |
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 | 路由参数 |
dispatchMethod(string $route) : \think\route\dispatch\Callback
解析URL地址为 模块/控制器/操作
string | $route | 路由地址 |
dispatchController(\think\Request $request, string $route) : \think\route\dispatch\Controller
解析URL地址为 模块/控制器/操作
\think\Request | $request | Request对象 |
string | $route | 路由地址 |
dispatchModule(\think\Request $request, string $route) : \think\route\dispatch\Module
解析URL地址为 模块/控制器/操作
\think\Request | $request | Request对象 |
string | $route | 路由地址 |
checkOption(array $option, \think\Request $request) : boolean
路由检查
array | $option | 路由参数 |
\think\Request | $request | Request对象 |
buildRuleRegex(string $rule, array $match, array $pattern = array(), array $option = array(), boolean $completeMatch = false, string $suffix = '') : string
生成路由的正则规则
string | $rule | 路由规则 |
array | $match | 匹配的变量 |
array | $pattern | 路由变量规则 |
array | $option | 路由参数 |
boolean | $completeMatch | 路由是否完全匹配 |
string | $suffix | 路由正则变量后缀 |