Route
Implements SerializableAn object representing a route definition.
since |
2.0.0 |
---|---|
package |
Joomla Framework |
Methods
__construct
Constructor.
__construct(array methods, string pattern, mixed controller, array rules = [], array defaults = []) : mixed
since |
2.0.0 |
---|
Arguments
- methods
array
The HTTP methods this route supports- pattern
string
The route pattern to use for matching- controller
mixed
The controller which handles this route- rules
array
An array of regex rules keyed using the route variables- defaults
array
The default variables defined by the route
Response
mixed
__serialize
Serialize the route.
__serialize() : array
since |
2.0.0 |
---|
Response
array
The data to be serialized
__unserialize
Unserialize the route.
__unserialize(array data) : void
since |
2.0.0 |
---|
Arguments
- data
array
The serialized route.
buildRegexAndVarList
Parse the route's pattern to extract the named variables and build a proper regular expression for use when parsing the routes.
buildRegexAndVarList() : void
since |
2.0.0 |
---|
getController
Retrieve the controller which handles this route
getController() : mixed
since |
2.0.0 |
---|
Response
mixed
getDefaults
Retrieve the default variables defined by the route
getDefaults() : array
since |
2.0.0 |
---|
Response
array
getMethods
Retrieve the HTTP methods this route supports
getMethods() : string[]
since |
2.0.0 |
---|
Response
string[]
getPattern
Retrieve the route pattern to use for matching
getPattern() : string
since |
2.0.0 |
---|
Response
string
getRegex
Retrieve the path regex this route processes
getRegex() : string
since |
2.0.0 |
---|
Response
string
getRouteVariables
Retrieve the variables defined by the route
getRouteVariables() : array
since |
2.0.0 |
---|
Response
array
getRules
Retrieve the regex rules keyed using the route variables
getRules() : array
since |
2.0.0 |
---|
Response
array
serialize
Serialize the route.
serialize() : string
since |
2.0.0 |
---|
Response
string
The serialized route.
setController
Set the controller which handles this route
setController(mixed controller) : $this
since |
2.0.0 |
---|
Arguments
- controller
mixed
The controller which handles this route
Response
$this
setDefaults
Set the default variables defined by the route
setDefaults(array defaults) : $this
since |
2.0.0 |
---|
Arguments
- defaults
array
The default variables defined by the route
Response
$this
setMethods
Set the HTTP methods this route supports
setMethods(array methods) : $this
since |
2.0.0 |
---|
Arguments
- methods
array
The HTTP methods this route supports
Response
$this
setPattern
Set the route pattern to use for matching
setPattern(string pattern) : $this
since |
2.0.0 |
---|
Arguments
- pattern
string
The route pattern to use for matching
Response
$this
setRegex
Set the path regex this route processes
setRegex(string regex) : $this
since |
2.0.0 |
---|
Arguments
- regex
string
The path regex this route processes
Response
$this
setRouteVariables
Set the variables defined by the route
setRouteVariables(array routeVariables) : $this
since |
2.0.0 |
---|
Arguments
- routeVariables
array
The variables defined by the route
Response
$this
setRules
Set the regex rules keyed using the route variables
setRules(array rules) : $this
since |
2.0.0 |
---|
Arguments
- rules
array
The rules defined by the route
Response
$this
unserialize
Unserialize the route.
unserialize(string serialized) : void
since |
1.0 |
---|
Arguments
- serialized
string
The serialized route.
Properties
controller
The controller which handles this route
since |
2.0.0 |
---|
Type(s)
mixed
defaults
The default variables defined by the route
since |
2.0.0 |
---|
Type(s)
array
methods
The HTTP methods this route supports
since |
2.0.0 |
---|
Type(s)
string[]
pattern
The route pattern to use for matching
since |
2.0.0 |
---|
Type(s)
string
regex
The path regex this route processes
since |
2.0.0 |
---|
Type(s)
string
routeVariables
The variables defined by the route
since |
2.0.0 |
---|
Type(s)
array
rules
An array of regex rules keyed using the route variables
since |
2.0.0 |
---|
Type(s)
array