ParameterAwareRoutePartInterface
interface ParameterAwareRoutePartInterface implements RoutePartInterface (View source)
Contract for Route parts that are aware of Routing RouteParameters
This extends the RoutePartInterface by a new method that allows Routing RouteParameters to be passed in when matching an incoming request.
Methods
Returns true if a value is set for this Route Part, otherwise false.
Returns value of the Route Part. Before match() is called this returns NULL.
Returns true if a default value is set for this Route Part, otherwise false.
Sets default value of the Route Part.
Specifies whether this Route part is optional.
Specifies whether this Route part should be converted to lower case when resolved.
Checks whether this Route Part corresponds to the given $routePath.
Checks whether this Route Part corresponds to the given $routeValues.
Details
void
setName(string $partName)
Sets name of the Route Part.
string
getName()
Returns name of the Route Part.
bool
hasValue()
Returns true if a value is set for this Route Part, otherwise false.
mixed
getValue()
Returns value of the Route Part. Before match() is called this returns NULL.
bool
hasDefaultValue()
Returns true if a default value is set for this Route Part, otherwise false.
void
setDefaultValue(mixed $defaultValue)
Sets default value of the Route Part.
mixed
getDefaultValue()
Gets default value of the Route Part.
void
setOptional(bool $isOptional)
Specifies whether this Route part is optional.
bool
isOptional()
No description
void
setLowerCase(bool $lowerCase)
Specifies whether this Route part should be converted to lower case when resolved.
bool
isLowerCase()
Getter for $this->lowerCase.
void
setOptions(array $options)
Defines options for this Route Part.
Options can be used to enrich a route part with parameters or settings like case sensivitity.
array
getOptions()
No description
bool|MatchResult
match(string $routePath)
Checks whether this Route Part corresponds to the given $routePath.
This method does not only check if the Route Part matches. It can also shorten the $routePath by the matching substring when matching is successful. This is why $routePath has to be passed by reference.
bool|ResolveResult
resolve(array $routeValues)
Checks whether this Route Part corresponds to the given $routeValues.
This method does not only check if the Route Part matches. It also removes resolved elements from $routeValues-Array. This is why $routeValues has to be passed by reference.
bool
matchWithParameters(string $routePath, RouteParameters $parameters)
No description