Route
class Route extends Route
Traits
Properties
protected array | $middleware | 中间件. |
from HasControllerAble |
protected array | $excludedMiddleware | 排除的中间件. |
from HasControllerAble |
Methods
RedirectResponse
redirect($url, int $status = 302, array $headers = [])
重定 url.
from
HasControllerAble
StreamedResponse
stream(null $callback = null, int $status = 200, array $headers = [])
返回流响应.
from
HasControllerAble
JsonResponse
json(array $data = [], int $status = 200, array $headers = [])
返回 json 响应.
from
HasControllerAble
BinaryFileResponse
sendFile($file, int $status = 200, array $headers = [], null $contentDisposition = null)
返回二进制文件响应.
from
HasControllerAble
addFinishHandler(callable $listener, int $priority = 0)
添加一个 KernelEvents::TERMINATE
事件监听处理器.
from
HasControllerAble
setFinishHandler(callable $listener, int $priority = 0)
设置一个 KernelEvents::TERMINATE
事件监听处理器.
from
HasControllerAble
__construct(string $path = '/', array $defaults = [], array $requirements = [], array $options = [], string|null $host = '', $schemes = [], $methods = [], string|null $condition = '')
No description
Details
in
HasControllerAble at line 41
string
render($name, $context = [])
{@inheritdoc}
in
HasControllerAble at line 52
RedirectResponse
redirect($url, int $status = 302, array $headers = [])
重定 url.
in
HasControllerAble at line 63
abort($statusCode, string $message = '', array $headers = [])
抛出 http 异常.
in
HasControllerAble at line 74
StreamedResponse
stream(null $callback = null, int $status = 200, array $headers = [])
返回流响应.
in
HasControllerAble at line 85
JsonResponse
json(array $data = [], int $status = 200, array $headers = [])
返回 json 响应.
in
HasControllerAble at line 97
BinaryFileResponse
sendFile($file, int $status = 200, array $headers = [], null $contentDisposition = null)
返回二进制文件响应.
in
HasControllerAble at line 105
array
getMiddleware()
获取中间件.
in
HasControllerAble at line 117
HasControllerAble
setMiddleware($middleware)
设置中间件.
in
HasControllerAble at line 129
HasControllerAble
addMiddleware($middleware)
添加中间件.
in
HasControllerAble at line 139
array
getExcludedMiddleware()
获取排除的中间件.
in
HasControllerAble at line 151
HasControllerAble
withoutMiddleware($excludedMiddleware)
排除中间件.
in
HasControllerAble at line 163
HasControllerAble
setExcludedMiddleware($excludedMiddleware)
设置排除的中间件.
in
HasControllerAble at line 175
HasControllerAble
addExcludedMiddleware($excludedMiddleware)
添加排除的中间件.
in
HasControllerAble at line 189
addFinishHandler(callable $listener, int $priority = 0)
添加一个 KernelEvents::TERMINATE
事件监听处理器.
用来处理耗时逻辑业务
in
HasControllerAble at line 203
setFinishHandler(callable $listener, int $priority = 0)
设置一个 KernelEvents::TERMINATE
事件监听处理器.
用来处理耗时逻辑业务
at line 21
__construct(string $path = '/', array $defaults = [], array $requirements = [], array $options = [], string|null $host = '', $schemes = [], $methods = [], string|null $condition = '')
No description