Avolutions\Routing\Route
A Route object which will be added to the RouteCollection. The Router class will find the corresponding Route object for the current request.
Properties
Property | Visibility | Type | Description |
---|---|---|---|
$actionName | public | string | The name of the Controller action |
$controllerName | public | string | The name of the Controller |
$method | public | string | The method of the Route |
$parameters | public | array | An array with all parameters and their options |
$url | public | string | The url of the Route |
Methods
Method | Visibility | Description |
---|---|---|
__construct() | public | Creates a new Route object with the given parameters. |
Property Details
$parameters
An array with all parameters and their options
public array<string|int, mixed> $parameters = []
Method Details
__construct()
Creates a new Route object with the given parameters.
public
__construct(string $url[, array<string|int, mixed> $defaults = [] ][, array<string|int, mixed> $parameters = [] ]) : mixed
Parameters
string
$url
The URL that will be mapped
array<string|int, mixed>
$defaults
(optional)
Default values for the Route
$defaults = [
'controller' => string Name of the controller
'action' => string Name of the action
'method' => string Name of the method (GET|POST)
]
array<string|int, mixed>
$parameters
(optional)
An array which contains all parameters and their options
'{param}' = [ => string Name of the parameter
'format' => string RegEx for valid format
'optional' => bool If true the parameter is optional
'default' => string Default value for the parameter if it is optional
]