|
| $routes = [] |
|
| $currentRoute = null |
|
| $logger = null |
|
| $defaultRoute = null |
|
| $e404Route = null |
|
SlaxWeb\Router\Container::__construct |
( |
\Psr\Log\LoggerInterface |
$logger | ) |
|
Class constructor
Store the retrieved logger that implements the to the class protected property.
- Parameters
-
\Psr\Log\LoggerInterface | $logger | Logger object |
SlaxWeb\Router\Container::add |
( |
Route |
$route | ) |
|
Add Route definition
Add the retrieved Route to the internal Routes container array. If the retrieved Route is not complete, throw the 'RouteIncompleteException'.
- Parameters
-
\SlaxWeb\Router\Route | $route | Route definition object |
- Returns
- self
SlaxWeb\Router\Container::defaultRoute |
( |
| ) |
|
Get default route
Returns the default route if set. If the default Route is not set, it returns null.
- Returns
- |null
SlaxWeb\Router\Container::get404Route |
( |
| ) |
|
Get the 404 route
Returns the 404 route if set. If the 404 Route is not set, it returns null.
- Returns
- |null
SlaxWeb\Router\Container::getAll |
( |
| ) |
|
Get all Routes
Return all sotred routes as an array.
- Returns
- array
SlaxWeb\Router\Container::iterateRoutes |
( |
string |
$function | ) |
|
|
protected |
Iterate internal Routes array
Provides a unified method for iterating the Routes array with PHP functions, 'next', 'prev', 'current', and 'end'. Returns the Route on the position that is desired, if no Route is found, false is returned.
- Parameters
-
string | $function | Function name for array iteration |
- Returns
- |bool
SlaxWeb\Router\Container::next |
( |
| ) |
|
Get next Route
Get the next Route, if the current Route is not yet set, return the first Route. If no next element is found, false is returned.
- Returns
- |bool
SlaxWeb\Router\Container::prev |
( |
| ) |
|
Get previous Route
Get the previous Route, if the current Route is not yet set, return the last Route. If no previous element is found, false is returned.
- Returns
- |bool
The documentation for this class was generated from the following file:
- /opt/slax0rDev/slaxweb/router/src/Container.php