AdministratorRouter
Extends RouterClass to create and parse routes
| since |
1.5 |
|---|---|
| package |
Joomla CMS |
Methods
__construct
Class constructor
__construct(array options = array()) : mixed
| since |
1.5 |
|---|
Arguments
- options
arrayArray of options
Response
mixed
_buildRawRoute
Function to build a raw route
_buildRawRoute(\JUri &uri) : string
| 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
| 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
| since |
1.5 |
|---|---|
| deprecated |
4.0 Use createUri() instead |
Arguments
- url
stringThe URI
Response
\JUri
_decodeSegments
Decode route segments
_decodeSegments(array segments) : array
| 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
| 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
| 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
| 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
| 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
| 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
| 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
| 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
| 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
| 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
| 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
| since |
3.2 |
|---|
Arguments
- url
stringThe URI or an associative array
Response
\JUri
decodeSegments
Decode route segments
decodeSegments(array segments) : array
| 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
| 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
| since |
1.5 |
|---|---|
| throws |
|
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
| since |
1.5 |
|---|---|
| deprecated |
4.0 |
Response
int
getVar
Get a router variable
getVar(string key) : mixed
| since |
1.5 |
|---|
Arguments
- key
stringThe name of the variable
Response
mixedValue of the variable
getVars
Get the router variable array
getVars() : array
| since |
1.5 |
|---|
Response
arrayAn associative array of router variables
parse
Function to convert a route to an internal URI
parse(\JUri &uri) : array
| since |
1.5 |
|---|
Arguments
- uri
\JUriThe uri.
Response
array
parseRawRoute
Function to convert a raw route to an internal URI
parseRawRoute(\JUri &uri) : array
| 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
| 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
| 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
| 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
| 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
| 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
| 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
| Value | 'preprocess' |
|---|---|
| since |
3.4 |
Type(s)
string
PROCESS_DURING
Mask for the during process stage
| Value | '' |
|---|---|
| since |
3.4 |
Type(s)
string
PROCESS_AFTER
Mask for the after process stage
| Value | 'postprocess' |
|---|---|
| since |
3.4 |
Type(s)
string
Properties
mode
The rewrite mode
| since |
1.5 |
|---|---|
| deprecated |
4.0 |
Type(s)
int
_mode
The rewrite mode
| since |
1.5 |
|---|---|
| deprecated |
4.0 |
Type(s)
int
vars
An array of variables
| since |
1.5 |
|---|
Type(s)
array
_vars
An array of variables
| since |
1.5 |
|---|---|
| deprecated |
4.0 Will convert to $vars |
Type(s)
array
rules
An array of rules
| since |
1.5 |
|---|
Type(s)
array
_rules
An array of rules
| since |
1.5 |
|---|---|
| deprecated |
4.0 Will convert to $rules |
Type(s)
array
cache
Caching of processed URIs
| since |
3.3 |
|---|
Type(s)
array
instances
Router instances container.
| since |
1.7 |
|---|
Type(s)
\Joomla\CMS\Router\Router[]