Properties

$bind

$bind : array

绑定对象

Type

array

$alwaysNewInstance

$alwaysNewInstance : bool

始终创建新的对象实例

Type

bool

Methods

bind()

bind(string|array  $name, string  $class = null) : object

绑定类的静态代理

Parameters

string|array $name

类标识

string $class

类名

Returns

object —

instance()

instance(mixed  ...$args) : mixed

带参数实例化当前Facade类

Parameters

mixed $args variadic

Returns

mixed —

make()

make(string  $class, array|true  $args = [], bool  $newInstance = false) : mixed

调用类的实例

Parameters

string $class

类名或者标识

array|true $args

变量

bool $newInstance

是否每次创建新的实例

Returns

mixed —

__callStatic()

__callStatic(mixed  $method, mixed  $params) : mixed

Parameters

mixed $method
mixed $params

Returns

mixed —

domain()

domain(mixed  $name, mixed  $rule = '', array  $option = [], array  $pattern = []) : \think\route\Domain

static 注册域名路由

Parameters

mixed $name
mixed $rule = ''
array $option = []
array $pattern = []

Returns

\think\route\Domain —

pattern()

pattern(mixed  $name, string  $rule = '') : \think\Route

static 注册变量规则

Parameters

mixed $name
string $rule = ''

Returns

\think\Route —

option()

option(mixed  $name, mixed  $value = '') : \think\Route

static 注册路由参数

Parameters

mixed $name
mixed $value = ''

Returns

\think\Route —

bind()

bind(string  $bind) : object

绑定类的静态代理

static 设置路由绑定

Parameters

string $bind

Returns

object —

getBind()

getBind(string  $bind) : mixed

static 读取路由绑定

Parameters

string $bind

Returns

mixed —

name()

name(string  $name) : \think\Route

static 设置当前路由标识

Parameters

string $name

Returns

\think\Route —

getName()

getName(string  $name) : mixed

static 读取路由标识

Parameters

string $name

Returns

mixed —

setName()

setName(string  $name) : void

static 批量导入路由标识

Parameters

string $name

import()

import(array  $rules, string  $type = '*') : void

static 导入配置文件的路由规则

Parameters

array $rules
string $type = '*'

rule()

rule(string  $rule, mixed  $route, string  $method = '*', array  $option = [], array  $pattern = []) : \think\route\RuleItem

static 注册路由规则

Parameters

string $rule
mixed $route
string $method = '*'
array $option = []
array $pattern = []

Returns

\think\route\RuleItem —

rules()

rules(array  $rules, string  $method = '*', array  $option = [], array  $pattern = []) : void

static 批量注册路由规则

Parameters

array $rules
string $method = '*'
array $option = []
array $pattern = []

group()

group(string|array  $name, array|\Closure  $route, array  $method = '*', array  $option = [], array  $pattern = []) : \think\route\RuleGroup

static 注册路由分组

Parameters

string|array $name
array|\Closure $route
array $method = '*'
array $option = []
array $pattern = []

Returns

\think\route\RuleGroup —

any()

any(string  $rule, mixed  $route, array  $option = [], array  $pattern = []) : \think\route\RuleItem

static 注册路由

Parameters

string $rule
mixed $route
array $option = []
array $pattern = []

Returns

\think\route\RuleItem —

get()

get(string  $rule, mixed  $route, array  $option = [], array  $pattern = []) : \think\route\RuleItem

static 注册路由

Parameters

string $rule
mixed $route
array $option = []
array $pattern = []

Returns

\think\route\RuleItem —

post()

post(string  $rule, mixed  $route, array  $option = [], array  $pattern = []) : \think\route\RuleItem

static 注册路由

Parameters

string $rule
mixed $route
array $option = []
array $pattern = []

Returns

\think\route\RuleItem —

put()

put(string  $rule, mixed  $route, array  $option = [], array  $pattern = []) : \think\route\RuleItem

static 注册路由

Parameters

string $rule
mixed $route
array $option = []
array $pattern = []

Returns

\think\route\RuleItem —

delete()

delete(string  $rule, mixed  $route, array  $option = [], array  $pattern = []) : \think\route\RuleItem

static 注册路由

Parameters

string $rule
mixed $route
array $option = []
array $pattern = []

Returns

\think\route\RuleItem —

patch()

patch(string  $rule, mixed  $route, array  $option = [], array  $pattern = []) : \think\route\RuleItem

static 注册路由

Parameters

string $rule
mixed $route
array $option = []
array $pattern = []

Returns

\think\route\RuleItem —

resource()

resource(string  $rule, mixed  $route, array  $option = [], array  $pattern = []) : \think\route\Resource

static 注册资源路由

Parameters

string $rule
mixed $route
array $option = []
array $pattern = []

Returns

\think\route\Resource —

controller()

controller(string  $rule, mixed  $route, array  $option = [], array  $pattern = []) : \think\Route

static 注册控制器路由

Parameters

string $rule
mixed $route
array $option = []
array $pattern = []

Returns

\think\Route —

alias()

alias(string  $rule, mixed  $route, array  $option = [], array  $pattern = []) : \think\Route

static 注册别名路由

Parameters

string $rule
mixed $route
array $option = []
array $pattern = []

Returns

\think\Route —

setMethodPrefix()

setMethodPrefix(mixed  $method, string  $prefix = '') : \think\Route

static 设置不同请求类型下面的方法前缀

Parameters

mixed $method
string $prefix = ''

Returns

\think\Route —

rest()

rest(string  $name, array  $resource = []) : \think\Route

static rest方法定义和修改

Parameters

string $name
array $resource = []

Returns

\think\Route —

miss()

miss(string  $route, string  $method = '*', array  $option = []) : \think\Route\RuleItem

static 注册未匹配路由规则后的处理

Parameters

string $route
string $method = '*'
array $option = []

Returns

\think\Route\RuleItem —

auto()

auto(string  $route) : \think\Route\RuleItem

static 注册一个自动解析的URL路由

Parameters

string $route

Returns

\think\Route\RuleItem —

check()

check(string  $url, string  $depr = '/', bool  $must = false, bool  $completeMatch = false) : \think\Route\Dispatch

static 检测URL路由

Parameters

string $url
string $depr = '/'
bool $must = false
bool $completeMatch = false

Returns

\think\Route\Dispatch —

createFacade()

createFacade(string  $class = '', array  $args = [], bool  $newInstance = false) : object

创建Facade实例

Parameters

string $class

类名或标识

array $args

变量

bool $newInstance

是否每次创建新的实例

Returns

object —

getFacadeClass()

getFacadeClass() : string

获取当前Facade对应类名(或者已经绑定的容器对象标识)

Returns

string —