Class Router
Router
This class organizes Slim application route objects. It is responsible for registering route objects, assigning names to route objects, finding routes that match the current HTTP request, and creating URLs for a named route.
- Slim\Router implements Slim\Interfaces\RouterInterface
Methods summary
public
|
|
public
|
|
public
|
#
setCacheFile( string|false $cacheFile )
Set path to fast route cache file. If this is false then route caching is disabled. |
public
|
|
public
|
|
public
array
|
|
protected
|
|
protected
FastRoute\Dispatcher
|
|
public
|
|
public
|
|
public
|
|
public
|
|
protected
string
|
|
public
|
|
public
|
|
public
|
|
public
string
|
#
relativePathFor( string $name, array $data = [], array $queryParams = [] )
Build the path for a named route excluding the base path |
public
string
|
|
public
string
|
Constants summary
Constants inherited from Slim\Interfaces\RouterInterface
Properties summary
protected
Psr\Container\ContainerInterface
|
$container
Container Interface |
|
protected
FastRoute\RouteParser
|
$routeParser
Parser |
|
protected
string
|
$basePath
Base path used in pathFor() |
#
''
|
protected
string|False
|
$cacheFile
Path to fast route cache file. Set to false to disable route caching |
#
false
|
protected
|
$routes
Routes |
#
[]
|
protected
integer
|
$routeCounter
Route counter incrementer |
#
0
|
protected
|
$routeGroups
Route groups |
#
[]
|
protected
FastRoute\Dispatcher
|
$dispatcher
|