\think\facadeMiddleware

Summary

Methods
Properties
Constants
__callStatic()
import()
add()
route()
controller()
unshift()
all()
pipeline()
end()
handleException()
No public properties found
No constants found
getFacadeClass()
createFacade()
$alwaysNewInstance
$instance
N/A
No private methods found
No private properties found
N/A

Properties

$alwaysNewInstance

$alwaysNewInstance : bool

始终创建新的对象实例

Type

bool

$instance

$instance

Methods

__callStatic()

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

Parameters

mixed $method
mixed $params

Returns

mixed —

import()

import(array  $middlewares = [], string  $type = 'global') : void

导入中间件

Parameters

array $middlewares = []
string $type = 'global'

add()

add(mixed  $middleware, string  $type = 'global') : void

注册中间件

Parameters

mixed $middleware
string $type = 'global'

route()

route(mixed  $middleware) : void

注册路由中间件

Parameters

mixed $middleware

controller()

controller(mixed  $middleware) : void

注册控制器中间件

Parameters

mixed $middleware

unshift()

unshift(mixed  $middleware, string  $type = 'global') : mixed

注册中间件到开始位置

Parameters

mixed $middleware
string $type = 'global'

Returns

mixed —

all()

all(string  $type = 'global') : array

获取注册的中间件

Parameters

string $type = 'global'

Returns

array —

pipeline()

pipeline(string  $type = 'global') : \think\facade\Pipeline

调度管道

Parameters

string $type = 'global'

Returns

\think\facade\Pipeline —

end()

end(\think\Response  $response) : mixed

结束调度

Parameters

\think\Response $response

Returns

mixed —

handleException()

handleException(\think\Request  $passable, \Throwable  $e) : \think\Response

异常处理

Parameters

\think\Request $passable
\Throwable $e

Returns

\think\Response —

getFacadeClass()

getFacadeClass() : string

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

Returns

string —

createFacade()

createFacade(bool  $newInstance = false) : object

创建Facade实例

Parameters

bool $newInstance

是否每次创建新的实例

Returns

object —