Router
class Router implements RequestHandlerInterface
Properties
| static Router|null | $instance |
Methods
Start the router, build the dispatcher, and handle the request.
Shortcut for a GET route that returns a view.
Add a CSRF exception.
Get the current route.
Create a route group with a common prefix.
Build the route dispatcher.
No description
No description
Details
at line 40
static Router
instance()
Get or create the singleton instance of the Router.
at line 50
static
start()
Start the router, build the dispatcher, and handle the request.
at line 73
Route
get(string $path, callable|string $handler)
Add a GET route.
at line 84
Route
post(string $path, callable|string $handler)
Add a POST route.
at line 95
Route
patch(string $path, callable|string $handler)
Add a PATCH route.
at line 106
Route
put(string $path, callable|string $handler)
Add a PUT route.
at line 117
Route
head(string $path, callable|string $handler)
Add a HEAD route.
at line 128
Route
delete(string $path, callable|string $handler)
Add a DELETE route.
at line 140
Route
view(string $url, string $name, array $arguments = [])
Shortcut for a GET route that returns a view.
at line 154
Route
add(string|array $methods, string $path, callable|string $handler)
Add a route to the router.
at line 169
static
addCSRFException(string $exception)
Add a CSRF exception.
at line 178
mixed
currentRoute()
Get the current route.
at line 189
RouteGroup
group(string $prefix, callable $callback)
Create a route group with a common prefix.
at line 208
void
buildDispatcher()
Build the route dispatcher.
at line 310
ResponseInterface
handle(ServerRequestInterface $request)
No description
at line 303
__construct(array $parsed)
No description