RouteDefinition
class RouteDefinition (View source)
Definitions for a specific route.
Constants
DYNAMIC_SEGMENT |
Value used to indicate a segment is dynamic rather than static |
Methods
RouteDefinition constructor.
Returns a new RouteDefinition instance based on the cached values.
Returns cached values for the RouteDefinition that can be used to instantiate a new RouteDefinition.
Returns the name of the route.
Returns the allowed methods for the route.
Returns the static segments for the route.
Returns the route handler.
Tells if the canonical route path ends in a forward slash or not.
Tells if the path is completely static without any dynamic segments.
Matches the given segments against the dynamic path segments.
Tells if the given HTTP request method is allowed by the route.
Returns an encoded URL for the route based on the given parameter values.
Details
at line 44
__construct(string $name, array $methods, string $path, mixed $handler)
RouteDefinition constructor.
at line 224
static RouteDefinition
createFromCache(array $cache)
Returns a new RouteDefinition instance based on the cached values.
at line 246
array
getDefinitionCache()
Returns cached values for the RouteDefinition that can be used to instantiate a new RouteDefinition.
at line 263
string
getName()
Returns the name of the route.
at line 272
array
getMethods()
Returns the allowed methods for the route.
at line 281
array
getSegments()
Returns the static segments for the route.
at line 290
mixed
getHandler()
Returns the route handler.
at line 299
bool
hasSlash()
Tells if the canonical route path ends in a forward slash or not.
at line 308
bool
isStatic()
Tells if the path is completely static without any dynamic segments.
at line 319
bool
matchPatterns(array $segments, array $values)
Matches the given segments against the dynamic path segments.
at line 345
bool
isMethodAllowed(string $method)
Tells if the given HTTP request method is allowed by the route.
at line 363
string
formatUrl(array $parameters = [])
Returns an encoded URL for the route based on the given parameter values.