-
bind ($context, $parameters)
Browse code
| $context |
The context |
| $parameters |
The parameters |
Binds the current route for a given context and parameters.
-
Compiles the current route instance.
-
compileForSeparator ()
Browse code
-
-
-
-
-
-
(string) generate ($params, $context, $absolute)
Browse code
| $params |
The parameter values |
| $context |
The context |
| $absolute |
Whether to generate an absolute URL |
Generates a URL from the given parameters.
returns The generated URL
-
generateStarParameter ()
Browse code
-
generateWithTokens ($parameters)
Browse code
| $parameters |
An array of parameters |
Generates a URL for the given parameters by using the route tokens.
-
-
getDefaultParameters ()
Browse code
-
(array) getDefaults ()
Browse code
Returns the compiled defaults.
returns The compiled defaults
-
Returns the compiled options.
returns The compiled options
-
(array) getParameters ()
Browse code
Returns the route parameters.
returns The route parameters
-
(string) getPattern ()
Browse code
Returns the compiled pattern.
returns The compiled pattern
-
Returns the compiled regex.
returns The compiled regex
-
(array) getRequirements ()
Browse code
Returns the compiled requirements.
returns The compiled requirements
-
Returns the compiled tokens.
returns The compiled tokens
-
(array) getVariables ()
Browse code
Returns the compiled variables.
returns The compiled variables
-
-
-
Returns true if the route is bound to context and parameters.
returns true if theroute is bound to context and parameters, false otherwise
-
(Boolean) matchesParameters ($params, $context)
Browse code
| $params |
The parameters |
| $context |
The context |
Returns true if the parameters matches this route, false otherwise.
returns true if the parameters matches this route, false otherwise.
-
(array) matchesUrl ($url, $context)
Browse code
| $url |
The URL |
| $context |
The context |
Returns an array of parameters if the URL matches this route, false otherwise.
returns An array of parameters
-
-
-
Post-compiles a route.
-
Pre-compiles a route.
-
-
-
setDefaultParameters ()
Browse code
-
Tokenizes the route.
-
(Boolean) tokenizeBufferAfter ($buffer, $tokens, $afterASeparator, $currentSeparator)
Browse code
| $buffer |
The current route buffer |
| $tokens |
An array of current tokens |
| $afterASeparator |
Whether the buffer is just after a separator |
| $currentSeparator |
The last matched separator |
Tokenizes the buffer after default logic is applied.
This method must return false if the buffer has not been parsed.
returns true if a token has been generated, false otherwise
-
(Boolean) tokenizeBufferBefore ($buffer, $tokens, $afterASeparator, $currentSeparator)
Browse code
| $buffer |
The current route buffer |
| $tokens |
An array of current tokens |
| $afterASeparator |
Whether the buffer is just after a separator |
| $currentSeparator |
The last matched separator |
Tokenizes the buffer before default logic is applied.
This method must return false if the buffer has not been parsed.
returns true if a token has been generated, false otherwise
-
-
__construct ($pattern, $defaults, $requirements, $options)
Browse code
| $pattern |
The pattern to match |
| $defaults |
An array of default parameter values |
| $requirements |
An array of requirements for parameters (regexes) |
| $options |
An array of options |
Constructor.
Available options:
* variable_prefixes: An array of characters that starts a variable name (: by default)
* segment_separators: An array of allowed characters for segment separators (/ and . by default)
* variable_regex: A regex that match a valid variable name ([\w\d_]+ by default)
* generate_shortest_url: Whether to generate the shortest URL possible (true by default)
* extra_parameters_as_query_string: Whether to generate extra parameters as a query string