Method | Description | |
---|---|---|
addRoute ( string | array $method, string $path, string $handler, string $name = null ) | Add a route to the router. | |
dispatch ( |
Dispatch a request in the router. | |
getCurrentRoute ( ) : |
Get the route matched to the current request. | |
getRoute ( string $name ) : |
Given a route name, get the route object. | |
group ( array $flags, Closure $callback ) : void | Define a route group. | |
mount ( array $routes, string $path = '/' ) : void | Mount an array config onto the routes. |
public addRoute ( string | array $method, string $path, string $handler, string $name = null ) | ||
$method | string | array | HTTP methods the route should respond to |
$path | string | Relative URL the route should respond to. Parameters wrapped in } |
$handler | string | string of "class:method" or "global_function" |
$name | string | Route name (optional) |
public dispatch ( |
||
$request | ||
return |
public getCurrentRoute ( ) : |
||
return |