RouterInterface
in
Expected behavior of a Router.
Table of Contents
- __construct() : mixed
- Stores a reference to the RouteCollection object.
- controllerName() : mixed
- Returns the name of the matched controller.
- handle() : mixed
- Scans the URI and attempts to match the current URI to the one of the defined routes in the RouteCollection.
- methodName() : mixed
- Returns the name of the method to run in the chosen container.
- params() : mixed
- Returns the binds that have been matched and collected during the parsing process as an array, ready to send to instance->method(...$params).
- setIndexPage() : mixed
- Sets the value that should be used to match the index.php file. Defaults to index.php but this allows you to modify it in case your are using something like mod_rewrite to remove the page. This allows you to set it a blank.
Methods
__construct()
Stores a reference to the RouteCollection object.
public
__construct(RouteCollectionInterface $routes[, Request $request = null ]) : mixed
Parameters
- $routes : RouteCollectionInterface
- $request : Request = null
Return values
mixed —controllerName()
Returns the name of the matched controller.
public
controllerName() : mixed
Return values
mixed —handle()
Scans the URI and attempts to match the current URI to the one of the defined routes in the RouteCollection.
public
handle([string $uri = null ]) : mixed
Parameters
- $uri : string = null
Return values
mixed —methodName()
Returns the name of the method to run in the chosen container.
public
methodName() : mixed
Return values
mixed —params()
Returns the binds that have been matched and collected during the parsing process as an array, ready to send to instance->method(...$params).
public
params() : mixed
Return values
mixed —setIndexPage()
Sets the value that should be used to match the index.php file. Defaults to index.php but this allows you to modify it in case your are using something like mod_rewrite to remove the page. This allows you to set it a blank.
public
setIndexPage(string $page) : mixed
Parameters
- $page : string