Interface RouterInterface
Interface for routers that the framework can utilize.
Methods summary
public
Symfony\Component\HttpFoundation\Response
|
#
dispatch( Symfony\Component\HttpFoundation\Request $request )
Dispatch a request in the router.
Dispatch a request in the router.
Parameters
Returns
Symfony\Component\HttpFoundation\Response
|
public
|
#
addRoute( string|array $method, string $path, string $handler, string $name = null )
Add a route to the router.
Add a route to the router.
Parameters
- $method
- HTTP methods the route should respond to
- $path
- Relative URL the route should respond to. Parameters wrapped in {}
- $handler
- string of "class:method" or "global_function"
- $name
- Route name (optional)
|
public
Autarky\Routing\Route
|
#
getRoute( string $name )
Given a route name, get the route object.
Given a route name, get the route object.
Parameters
Returns
Throws
InvalidArgumentException if route with the name does not exist
|
public
Autarky\Routing\Route
|
#
getCurrentRoute( )
Get the route matched to the current request.
Get the route matched to the current request.
Returns
|
public
|
#
group( array $flags, Closure $callback )
Define a route group.
Parameters
- $flags
- Valid keys are 'before', 'after', 'prefix'
- $callback
- First argument is the router ($this)
|
public
|
#
mount( array $routes, string $path = '/' )
Mount an array config onto the routes.
Mount an array config onto the routes.
Parameters
|