Class RouteDefinition
The class defines options that can be used to define a route as well as means to normalize and
validate this definition.
Methods summary
public static
normalize( array & $definition
)
Normalizes a route definition.
Normalizes a route definition.
Parameters
public static
ensure_has_id( array & $definition
)
: string
Ensures that a route definition has an identifier and generates one if required.
Ensures that a route definition has an identifier and generates one if required.
Parameters
Returns
string
The route identifier.
public static
assert_is_valid( array $definition
)
Asserts that a route definition is valid.
Asserts that a route definition is valid.
Parameters
Throws
Constants summary
PATTERN
: string
'pattern'
CONTROLLER
: string
A controller class name (with an optional action) or a callable.
A controller class name (with an optional action) or a callable.
'controller'
LOCATION
: string
'location'
VIA
: string
Request method(s) accepted by the route.
Request method(s) accepted by the route.
'via'
CONSTRUCTOR
: string
Route constructor, a class name for now.
Route constructor, a class name for now.
'class'