public
Slim\Interfaces\RouteInterface
|
#
map( string[] $methods, string $pattern, callable $handler )
Add route
Parameters
- $methods
- Array of HTTP methods
- $pattern
- The route pattern
- $handler
- The route callable
Returns
|
public
array
|
#
dispatch( Psr\Http\Message\ServerRequestInterface $request )
Dispatch router for HTTP request
Dispatch router for HTTP request
Parameters
- $request
- The current HTTP request object
Returns
array
Link
|
public
Slim\Interfaces\RouteGroupInterface
|
#
pushGroup( string $pattern, callable $callable )
Add a route group to the array
Add a route group to the array
Parameters
- $pattern
- The group pattern
- $callable
- A group callable
Returns
|
public
boolean
|
#
popGroup( )
Removes the last route group from the array
Removes the last route group from the array
Returns
boolean True if successful, else False
|
public
Slim\Interfaces\RouteInterface
|
#
getNamedRoute( string $name )
Get named route object
Parameters
Returns
Throws
RuntimeException If named route does not exist
|
public
Slim\Interfaces\RouteInterface
|
|
public
string
|
#
relativePathFor( string $name, array $data = [], array $queryParams = [] )
Build the path for a named route excluding the base path
Build the path for a named route excluding the base path
Parameters
- $name
- Route name
- $data
- Named argument replacement data
- $queryParams
- Optional query string parameters
Returns
string
Throws
RuntimeException If named route does not exist
InvalidArgumentException If required data not provided
|
public
string
|
#
pathFor( string $name, array $data = [], array $queryParams = [] )
Build the path for a named route including the base path
Build the path for a named route including the base path
Parameters
- $name
- Route name
- $data
- Named argument replacement data
- $queryParams
- Optional query string parameters
Returns
string
Throws
RuntimeException If named route does not exist
InvalidArgumentException If required data not provided
|