Properties

$app

$app : \think\App

应用对象

Type

App

$request

$request : \think\Request

请求对象

Type

Request

$rule

$rule : \think\route\Rule

路由规则

Type

Rule

$dispatch

$dispatch : mixed

调度信息

Type

mixed

$param

$param : array

调度参数

Type

array

$code

$code : string

状态码

Type

string

$convert

$convert : bool

是否进行大小写转换

Type

bool

Methods

__construct()

__construct(\think\Request  $request, \think\route\Rule  $rule, mixed  $dispatch, mixed  $param = [], mixed  $code = null) : mixed

Parameters

\think\Request $request
\think\route\Rule $rule
mixed $dispatch
mixed $param
mixed $code

Returns

mixed —

init()

init() : mixed

Returns

mixed —

run()

run() : mixed

执行路由调度

Returns

mixed —

convert()

convert(mixed  $convert) : mixed

Parameters

mixed $convert

Returns

mixed —

getDispatch()

getDispatch() : mixed

Returns

mixed —

getParam()

getParam() : mixed

Returns

mixed —

exec()

exec() : mixed

Returns

mixed —

__sleep()

__sleep() : mixed

Returns

mixed —

__wakeup()

__wakeup() : mixed

Returns

mixed —

__debugInfo()

__debugInfo() : mixed

Returns

mixed —

doRouteAfter()

doRouteAfter() : void

检查路由后置操作

autoResponse()

autoResponse(mixed  $data) : mixed

Parameters

mixed $data

Returns

mixed —

checkAfter()

checkAfter(mixed  $after) : mixed

检查路由后置行为

Parameters

mixed $after

后置行为

Returns

mixed —

autoValidate()

autoValidate(array  $option) : void

验证数据

Parameters

array $option

Throws

\think\exception\ValidateException

parseRequestCache()

parseRequestCache(string|array  $cache) : void

处理路由请求缓存

Parameters

string|array $cache

路由缓存

createBindModel()

createBindModel(array|\Clousre  $bindModel, array  $matches) : void

路由绑定模型实例

Parameters

array|\Clousre $bindModel

绑定模型

array $matches

路由变量

parseUrl()

parseUrl(string  $url) : array

解析URL地址

Parameters

string $url

URL

Returns

array —

hasDefinedRoute()

hasDefinedRoute(string  $route, string  $bind) : bool

检查URL是否已经定义过路由

Parameters

string $route

路由信息

string $bind

绑定信息

Returns

bool —

autoFindController()

autoFindController(string  $module, array  $path) : string

自动定位控制器类

Parameters

string $module

模块名

array $path

URL

Returns

string —