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
arrayThe HTTP methods this route supports- pattern
stringThe route pattern to use for matching- controller
mixedThe controller which handles this route- rules
arrayAn array of regex rules keyed using the route variables- defaults
arrayThe default variables defined by the route
Response
mixed
__serialize
Serialize the route.
__serialize() : array
| since |
2.0.0 |
|---|
Response
arrayThe data to be serialized
__unserialize
Unserialize the route.
__unserialize(array data) : void
| since |
2.0.0 |
|---|
Arguments
- data
arrayThe 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
stringThe serialized route.
setController
Set the controller which handles this route
setController(mixed controller) : $this
| since |
2.0.0 |
|---|
Arguments
- controller
mixedThe 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
arrayThe 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
arrayThe 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
stringThe 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
stringThe 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
arrayThe 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
arrayThe rules defined by the route
Response
$this
unserialize
Unserialize the route.
unserialize(string serialized) : void
| since |
1.0 |
|---|
Arguments
- serialized
stringThe 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