Route

Implements Serializable

An object representing a route definition.

since

2.0.0

package

Joomla Framework

Methods

__construct

Constructor.

__construct(mixed||string|int methods,  pattern,  controller, mixed||string|int rules = [], mixed||string|int defaults = []) : 
since

2.0.0

Arguments

methods

array<string|int, mixed>The HTTP methods this route supports

pattern

stringThe route pattern to use for matching

controller

mixedThe controller which handles this route

rules

array<string|int, mixed>An array of regex rules keyed using the route variables

defaults

array<string|int, mixed>The default variables defined by the route

Response

mixed

__serialize

Serialize the route.

__serialize() : mixed||string|int
since

2.0.0

Response

array<string|int, mixed>The data to be serialized

__unserialize

Unserialize the route.

__unserialize(mixed||string|int data) : 
since

2.0.0

Arguments

data

array<string|int, mixed>The serialized route.

Response

void

buildRegexAndVarList

Parse the route's pattern to extract the named variables and build a proper regular expression for use when parsing the routes.

buildRegexAndVarList() : 
since

2.0.0

Response

void

getController

Retrieve the controller which handles this route

getController() : 
since

2.0.0

Response

mixed

getDefaults

Retrieve the default variables defined by the route

getDefaults() : mixed||string|int
since

2.0.0

Response

array<string|int, mixed>

getMethods

Retrieve the HTTP methods this route supports

getMethods() : string||string|int
since

2.0.0

Response

array<string|int, string>

getPattern

Retrieve the route pattern to use for matching

getPattern() : 
since

2.0.0

Response

string

getRegex

Retrieve the path regex this route processes

getRegex() : 
since

2.0.0

Response

string

getRouteVariables

Retrieve the variables defined by the route

getRouteVariables() : mixed||string|int
since

2.0.0

Response

array<string|int, mixed>

getRules

Retrieve the regex rules keyed using the route variables

getRules() : mixed||string|int
since

2.0.0

Response

array<string|int, mixed>

serialize

Serialize the route.

serialize() : 
since

2.0.0

Response

stringThe serialized route.

setController

Set the controller which handles this route

setController( controller) : 
since

2.0.0

Arguments

controller

mixedThe controller which handles this route

Response

$this

setDefaults

Set the default variables defined by the route

setDefaults(mixed||string|int defaults) : 
since

2.0.0

Arguments

defaults

array<string|int, mixed>The default variables defined by the route

Response

$this

setMethods

Set the HTTP methods this route supports

setMethods(mixed||string|int methods) : 
since

2.0.0

Arguments

methods

array<string|int, mixed>The HTTP methods this route supports

Response

$this

setPattern

Set the route pattern to use for matching

setPattern( pattern) : 
since

2.0.0

Arguments

pattern

stringThe route pattern to use for matching

Response

$this

setRegex

Set the path regex this route processes

setRegex( regex) : 
since

2.0.0

Arguments

regex

stringThe path regex this route processes

Response

$this

setRouteVariables

Set the variables defined by the route

setRouteVariables(mixed||string|int routeVariables) : 
since

2.0.0

Arguments

routeVariables

array<string|int, mixed>The variables defined by the route

Response

$this

setRules

Set the regex rules keyed using the route variables

setRules(mixed||string|int rules) : 
since

2.0.0

Arguments

rules

array<string|int, mixed>The rules defined by the route

Response

$this

unserialize

Unserialize the route.

unserialize( serialized) : 
since

1.0

Arguments

serialized

stringThe serialized route.

Response

void

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<string|int, mixed>

methods

The HTTP methods this route supports

since

2.0.0

Type(s)

array<string|int, 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<string|int, mixed>

rules

An array of regex rules keyed using the route variables

since

2.0.0

Type(s)

array<string|int, mixed>