AdministratorRouter

Extends Router

Class to create and parse routes

since

1.5

package

Joomla CMS

Methods

__construct

Class constructor

__construct(array options = array()) : mixed
inherited
since

1.5

Arguments

options

arrayArray of options

Response

mixed

_buildRawRoute

Function to build a raw route

_buildRawRoute(\JUri &uri) : string
inherited deprecated
since

1.5

deprecated

4.0 Attach your logic as rule to the main build stage

Arguments

uri

\JUriThe internal URL

Response

stringRaw Route

_buildSefRoute

Function to build a sef route

_buildSefRoute(\JUri &uri) : string
inherited deprecated
since

1.5

deprecated

4.0 Attach your logic as rule to the main build stage

Arguments

uri

\JUriThe uri

Response

stringThe SEF route

_createUri

Create a uri based on a full or partial URL string

_createUri(string url) : \JUri
inherited deprecated
since

1.5

deprecated

4.0 Use createUri() instead

Arguments

url

stringThe URI

Response

\JUri

_decodeSegments

Decode route segments

_decodeSegments(array segments) : array
inherited deprecated
since

1.5

deprecated

4.0 This should be performed in the component router instead

Arguments

segments

arrayAn array of route segments

Response

arrayArray of decoded route segments

_encodeSegments

Encode route segments

_encodeSegments(array segments) : array
inherited deprecated
since

1.5

deprecated

4.0 This should be performed in the component router instead

Arguments

segments

arrayAn array of route segments

Response

arrayArray of encoded route segments

_parseRawRoute

Function to convert a raw route to an internal URI

_parseRawRoute(\JUri &uri) : bool
inherited deprecated
since

1.5

deprecated

4.0 Attach your logic as rule to the main parse stage

Arguments

uri

\JUriThe raw route

Response

bool

_parseSefRoute

Function to convert a sef route to an internal URI

_parseSefRoute(\JUri &uri) : string
inherited deprecated
since

1.5

deprecated

4.0 Attach your logic as rule to the main parse stage

Arguments

uri

\JUriThe sef URI

Response

stringInternal URI

_processBuildRules

Process the build uri query data based on custom defined rules

_processBuildRules(\JUri &uri) : void
inherited deprecated
since

1.5

deprecated

4.0 Use processBuildRules() instead

Arguments

uri

\JUriThe URI

_processParseRules

Process the parsed router variables based on custom defined rules

_processParseRules(\JUri &uri) : array
inherited deprecated
since

1.5

deprecated

4.0 Use processParseRules() instead

Arguments

uri

\JUriThe URI to parse

Response

arrayThe array of processed URI variables

attachBuildRule

Attach a build rule

attachBuildRule(callable callback, string stage = self::PROCESS_DURING) : void
inherited
since

1.5

Arguments

callback

callableThe function to be called

stage

stringThe stage of the build process that this should be added to. Possible values: 'preprocess', '' for the main build process, 'postprocess'

attachParseRule

Attach a parse rule

attachParseRule(callable callback, string stage = self::PROCESS_DURING) : void
inherited
since

1.5

Arguments

callback

callableThe function to be called.

stage

stringThe stage of the parse process that this should be added to. Possible values: 'preprocess', '' for the main parse process, 'postprocess'

build

Function to convert an internal URI to a route

build(string url) : \JUri
inherited
since

1.5

Arguments

url

stringThe internal URL or an associative array

Response

\JUriThe absolute search engine friendly URL object

buildRawRoute

Function to build a raw route

buildRawRoute(\JUri &uri) : string
inherited deprecated
since

3.2

deprecated

4.0 Attach your logic as rule to the main build stage

Arguments

uri

\JUriThe internal URL

Response

stringRaw Route

buildSefRoute

Function to build a sef route

buildSefRoute(\JUri &uri) : string
inherited deprecated
since

3.2

deprecated

4.0 Attach your logic as rule to the main build stage

Arguments

uri

\JUriThe uri

Response

stringThe SEF route

createUri

Create a uri based on a full or partial URL string

createUri(string url) : \JUri
inherited
since

3.2

Arguments

url

stringThe URI or an associative array

Response

\JUri

decodeSegments

Decode route segments

decodeSegments(array segments) : array
inherited deprecated
since

3.2

deprecated

4.0 This should be performed in the component router instead

Arguments

segments

arrayAn array of route segments

Response

arrayArray of decoded route segments

encodeSegments

Encode route segments

encodeSegments(array segments) : array
inherited deprecated
since

3.2

deprecated

4.0 This should be performed in the component router instead

Arguments

segments

arrayAn array of route segments

Response

arrayArray of encoded route segments

getInstance

Returns the global Router object, only creating it if it doesn't already exist.

getInstance(string client, array options = array()) : \Joomla\CMS\Router\Router
inherited static
since

1.5

throws

\RuntimeException

Arguments

client

stringThe name of the client

options

arrayAn associative array of options

Response

\Joomla\CMS\Router\RouterA Router object.

getMode

Get the router mode

getMode() : int
inherited deprecated
since

1.5

deprecated

4.0

Response

int

getVar

Get a router variable

getVar(string key) : mixed
inherited
since

1.5

Arguments

key

stringThe name of the variable

Response

mixedValue of the variable

getVars

Get the router variable array

getVars() : array
inherited
since

1.5

Response

arrayAn associative array of router variables

parse

Function to convert a route to an internal URI

parse(\JUri &uri) : array
inherited
since

1.5

Arguments

uri

\JUriThe uri.

Response

array

parseRawRoute

Function to convert a raw route to an internal URI

parseRawRoute(\JUri &uri) : array
inherited deprecated
since

3.2

deprecated

4.0 Attach your logic as rule to the main parse stage

Arguments

uri

\JUriThe raw route

Response

arrayArray of variables

parseSefRoute

Function to convert a sef route to an internal URI

parseSefRoute(\JUri &uri) : array
inherited deprecated
since

3.2

deprecated

4.0 Attach your logic as rule to the main parse stage

Arguments

uri

\JUriThe sef URI

Response

arrayArray of variables

processBuildRules

Process the build uri query data based on custom defined rules

processBuildRules(\JUri &uri, string stage = self::PROCESS_DURING) : void
inherited
since

3.2

Arguments

uri

\JUriThe URI

stage

stringThe stage that should be processed. Possible values: 'preprocess', 'postprocess' and '' for the main build stage

processParseRules

Process the parsed router variables based on custom defined rules

processParseRules(\JUri &uri, string stage = self::PROCESS_DURING) : array
inherited
since

3.2

Arguments

uri

\JUriThe URI to parse

stage

stringThe stage that should be processed. Possible values: 'preprocess', 'postprocess' and '' for the main parse stage

Response

arrayThe array of processed URI variables

setMode

Set the router mode

setMode(int mode) : void
inherited deprecated
since

1.5

deprecated

4.0

Arguments

mode

intThe routing mode.

setVar

Set a router variable, creating it if it doesn't exist

setVar(string key, mixed value, bool create = true) : void
inherited
since

1.5

Arguments

key

stringThe name of the variable

value

mixedThe value of the variable

create

boolIf True, the variable will be created if it doesn't exist yet

setVars

Set the router variable array

setVars(array vars = array(), bool merge = true) : void
inherited
since

1.5

Arguments

vars

arrayAn associative array with variables

merge

boolIf True, the array will be merged instead of overwritten

Constants

PROCESS_BEFORE

Mask for the before process stage

inherited
Value 'preprocess'
since

3.4

Type(s)

string

PROCESS_DURING

Mask for the during process stage

inherited
Value ''
since

3.4

Type(s)

string

PROCESS_AFTER

Mask for the after process stage

inherited
Value 'postprocess'
since

3.4

Type(s)

string

Properties

mode

The rewrite mode

inherited deprecated
since

1.5

deprecated

4.0

Type(s)

int

_mode

The rewrite mode

inherited deprecated
since

1.5

deprecated

4.0

Type(s)

int

vars

An array of variables

inherited
since

1.5

Type(s)

array

_vars

An array of variables

inherited deprecated
since

1.5

deprecated

4.0 Will convert to $vars

Type(s)

array

rules

An array of rules

inherited
since

1.5

Type(s)

array

_rules

An array of rules

inherited deprecated
since

1.5

deprecated

4.0 Will convert to $rules

Type(s)

array

cache

Caching of processed URIs

inherited
since

3.3

Type(s)

array

instances

Router instances container.

inherited static
since

1.7

Type(s)

\Joomla\CMS\Router\Router[]