Maps the URIs to the Controllers.
More...
Maps the URIs to the Controllers.
This class is used to call a specific Controller based on a given route.
Definition at line 10 of file Route.php.
◆ analyzeError()
static analyzeError |
( |
\Error |
$e | ) |
|
|
static |
When first running NanoFramework, if something is not correcly set, this method intercepts the error and displays the message explaining how to fix it.
Definition at line 137 of file Route.php.
◆ display()
Displays the correct page based on the URI.
If the URI is found in the list of specific routes, it is first translated into a standard route. The corresponding Controller is then called.
This method intercepts RedirectException to redirect to the correct location.
Definition at line 104 of file Route.php.
◆ getNamespace()
Shows the current namespace used by this class.
- Returns
- string The current namespace
Definition at line 82 of file Route.php.
◆ getSpecificRoutes()
static getSpecificRoutes |
( |
| ) |
|
|
static |
Lists a deep copy of all the specific routes saved in the current class.
- Returns
- array All the specific routes recorded
Definition at line 92 of file Route.php.
◆ getUri()
static getUri |
( |
string |
$uri | ) |
|
|
staticprotected |
This method allows to translate a specific route into a standard route.
- Parameters
-
string | $uri | the specific URI to translate |
- Returns
- string The standard corresponding URI
Definition at line 164 of file Route.php.
◆ load()
static load |
( |
string |
$source | ) |
|
|
static |
Loads a route file located at the provided place and populates the Route::specificRoutes attribute.
See routeSyntax
for more information about the syntax of the routes file.
- Parameters
-
string | $source | the location of the routes files |
Definition at line 29 of file Route.php.
◆ setNamespace()
static setNamespace |
( |
string |
$namespace | ) |
|
|
static |
Sets the namespace to a custom value.
- Parameters
-
string | $namespace | the new namespace for the user-defined classes |
Definition at line 72 of file Route.php.
◆ $namespace
The namespace where to find the code written by the user.
Definition at line 15 of file Route.php.
◆ $specificRoutes
The list of the routes that don't match the default pattern.
Definition at line 20 of file Route.php.
The documentation for this class was generated from the following file: