Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe Router
+ Graphe d'héritage de Router:

Fonctions membres publiques

 __construct ($options=array())
 
 parse (&$uri)
 
 build ($url)
 
 getMode ()
 
 setMode ($mode)
 
 setVar ($key, $value, $create=true)
 
 setVars ($vars=array(), $merge=true)
 
 getVar ($key)
 
 getVars ()
 
 attachBuildRule ($callback, $stage=self::PROCESS_DURING)
 
 attachParseRule ($callback, $stage=self::PROCESS_DURING)
 

Fonctions membres publiques statiques

static getInstance ($client, $options=array())
 

Champs de données

const PROCESS_BEFORE = 'preprocess'
 
const PROCESS_DURING = ''
 
const PROCESS_AFTER = 'postprocess'
 

Fonctions membres protégées

 _parseRawRoute (&$uri)
 
 parseRawRoute (&$uri)
 
 _parseSefRoute (&$uri)
 
 parseSefRoute (&$uri)
 
 _buildRawRoute (&$uri)
 
 buildRawRoute (&$uri)
 
 _buildSefRoute (&$uri)
 
 buildSefRoute (&$uri)
 
 _processParseRules (&$uri)
 
 processParseRules (&$uri, $stage=self::PROCESS_DURING)
 
 _processBuildRules (&$uri)
 
 processBuildRules (&$uri, $stage=self::PROCESS_DURING)
 
 _createUri ($url)
 
 createUri ($url)
 
 _encodeSegments ($segments)
 
 encodeSegments ($segments)
 
 _decodeSegments ($segments)
 
 decodeSegments ($segments)
 

Attributs protégés

 $mode = null
 
 $_mode = null
 
 $vars = array()
 
 $_vars = array()
 
 $rules
 
 $_rules
 
 $cache = array()
 

Attributs protégés statiques

static $instances = array()
 

Description détaillée

Class to create and parse routes

Depuis
1.5

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $options = array())

Class constructor

Paramètres
array$optionsArray of options
Depuis
1.5

Références $options, et JROUTER_MODE_RAW.

Documentation des fonctions membres

◆ _buildRawRoute()

_buildRawRoute ( $uri)
protected

Function to build a raw route

Paramètres
\JUri&$uriThe internal URL
Renvoie
string Raw Route
Depuis
1.5
Obsolète:
4.0 Attach your logic as rule to the main build stage

Références $uri.

◆ _buildSefRoute()

_buildSefRoute ( $uri)
protected

Function to build a sef route

Paramètres
\JUri&$uriThe uri
Renvoie
string The SEF route
Depuis
1.5
Obsolète:
4.0 Attach your logic as rule to the main build stage

Références $uri.

◆ _createUri()

_createUri (   $url)
protected

Create a uri based on a full or partial URL string

Paramètres
string$urlThe URI
Renvoie
Depuis
1.5
Obsolète:
4.0 Use createUri() instead

Références $url.

◆ _decodeSegments()

_decodeSegments (   $segments)
protected

Decode route segments

Paramètres
array$segmentsAn array of route segments
Renvoie
array Array of decoded route segments
Depuis
1.5
Obsolète:
4.0 This should be performed in the component router instead

◆ _encodeSegments()

_encodeSegments (   $segments)
protected

Encode route segments

Paramètres
array$segmentsAn array of route segments
Renvoie
array Array of encoded route segments
Depuis
1.5
Obsolète:
4.0 This should be performed in the component router instead

◆ _parseRawRoute()

_parseRawRoute ( $uri)
protected

Function to convert a raw route to an internal URI

Paramètres
\JUri&$uriThe raw route
Renvoie
boolean
Depuis
1.5
Obsolète:
4.0 Attach your logic as rule to the main parse stage

Références $uri.

◆ _parseSefRoute()

_parseSefRoute ( $uri)
protected

Function to convert a sef route to an internal URI

Paramètres
\JUri&$uriThe sef URI
Renvoie
string Internal URI
Depuis
1.5
Obsolète:
4.0 Attach your logic as rule to the main parse stage

Références $uri.

◆ _processBuildRules()

_processBuildRules ( $uri)
protected

Process the build uri query data based on custom defined rules

Paramètres
\JUri&$uriThe URI
Renvoie
void
Depuis
1.5
Obsolète:
4.0 Use processBuildRules() instead

Références $uri.

◆ _processParseRules()

_processParseRules ( $uri)
protected

Process the parsed router variables based on custom defined rules

Paramètres
\JUri&$uriThe URI to parse
Renvoie
array The array of processed URI variables
Depuis
1.5
Obsolète:
4.0 Use processParseRules() instead

Références $uri.

◆ attachBuildRule()

attachBuildRule (   $callback,
  $stage = self::PROCESS_DURING 
)

Attach a build rule

Paramètres
callable$callbackThe function to be called
string$stageThe stage of the build process that this should be added to. Possible values: 'preprocess', '' for the main build process, 'postprocess'
Renvoie
void
Depuis
1.5

◆ attachParseRule()

attachParseRule (   $callback,
  $stage = self::PROCESS_DURING 
)

Attach a parse rule

Paramètres
callable$callbackThe function to be called.
string$stageThe stage of the parse process that this should be added to. Possible values: 'preprocess', '' for the main parse process, 'postprocess'
Renvoie
void
Depuis
1.5

◆ build()

build (   $url)

Function to convert an internal URI to a route

Paramètres
string$urlThe internal URL or an associative array
Renvoie
The absolute search engine friendly URL object
Depuis
1.5

Références $key, $uri, $url, JROUTER_MODE_RAW, et JROUTER_MODE_SEF.

◆ buildRawRoute()

buildRawRoute ( $uri)
protected

Function to build a raw route

Paramètres
\JUri&$uriThe internal URL
Renvoie
string Raw Route
Depuis
3.2
Obsolète:
4.0 Attach your logic as rule to the main build stage

◆ buildSefRoute()

buildSefRoute ( $uri)
protected

Function to build a sef route

Paramètres
\JUri&$uriThe uri
Renvoie
string The SEF route
Depuis
3.2
Obsolète:
4.0 Attach your logic as rule to the main build stage

◆ createUri()

createUri (   $url)
protected

Create a uri based on a full or partial URL string

Paramètres
string$urlThe URI or an associative array
Renvoie
Depuis
3.2

Références $key, $uri, et $url.

◆ decodeSegments()

decodeSegments (   $segments)
protected

Decode route segments

Paramètres
array$segmentsAn array of route segments
Renvoie
array Array of decoded route segments
Depuis
3.2
Obsolète:
4.0 This should be performed in the component router instead

Références $i, et $total.

◆ encodeSegments()

encodeSegments (   $segments)
protected

Encode route segments

Paramètres
array$segmentsAn array of route segments
Renvoie
array Array of encoded route segments
Depuis
3.2
Obsolète:
4.0 This should be performed in the component router instead

Références $i, et $total.

◆ getInstance()

static getInstance (   $client,
  $options = array() 
)
static

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

Paramètres
string$clientThe name of the client
array$optionsAn associative array of options
Renvoie
Router A Router object.
Depuis
1.5
Exceptions

Références $client, $info, $options, $path, ApplicationHelper\getClientInfo(), et JLoader\register().

◆ getMode()

getMode ( )

Get the router mode

Renvoie
integer
Depuis
1.5
Obsolète:
4.0

◆ getVar()

getVar (   $key)

Get a router variable

Paramètres
string$keyThe name of the variable
Renvoie
mixed Value of the variable
Depuis
1.5

Références $key, et null.

◆ getVars()

getVars ( )

Get the router variable array

Renvoie
array An associative array of router variables
Depuis
1.5

◆ parse()

parse ( $uri)

Function to convert a route to an internal URI

Paramètres
\JUri&$uriThe uri.
Renvoie
array
Depuis
1.5

Références $uri, ComponentHelper\getParams(), JROUTER_MODE_RAW, et JROUTER_MODE_SEF.

◆ parseRawRoute()

parseRawRoute ( $uri)
protected

Function to convert a raw route to an internal URI

Paramètres
\JUri&$uriThe raw route
Renvoie
array Array of variables
Depuis
3.2
Obsolète:
4.0 Attach your logic as rule to the main parse stage

◆ parseSefRoute()

parseSefRoute ( $uri)
protected

Function to convert a sef route to an internal URI

Paramètres
\JUri&$uriThe sef URI
Renvoie
array Array of variables
Depuis
3.2
Obsolète:
4.0 Attach your logic as rule to the main parse stage

◆ processBuildRules()

processBuildRules ( $uri,
  $stage = self::PROCESS_DURING 
)
protected

Process the build uri query data based on custom defined rules

Paramètres
\JUri&$uriThe URI
string$stageThe stage that should be processed. Possible values: 'preprocess', 'postprocess' and '' for the main build stage
Renvoie
void
Depuis
3.2

Références $uri.

◆ processParseRules()

processParseRules ( $uri,
  $stage = self::PROCESS_DURING 
)
protected

Process the parsed router variables based on custom defined rules

Paramètres
\JUri&$uriThe URI to parse
string$stageThe stage that should be processed. Possible values: 'preprocess', 'postprocess' and '' for the main parse stage
Renvoie
array The array of processed URI variables
Depuis
3.2

Références $uri.

◆ setMode()

setMode (   $mode)

Set the router mode

Paramètres
integer$modeThe routing mode.
Renvoie
void
Depuis
1.5
Obsolète:
4.0

Références $mode.

◆ setVar()

setVar (   $key,
  $value,
  $create = true 
)

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

Paramètres
string$keyThe name of the variable
mixed$valueThe value of the variable
boolean$createIf True, the variable will be created if it doesn't exist yet
Renvoie
void
Depuis
1.5

Références $key, et $value.

◆ setVars()

setVars (   $vars = array(),
  $merge = true 
)

Set the router variable array

Paramètres
array$varsAn associative array with variables
boolean$mergeIf True, the array will be merged instead of overwritten
Renvoie
void
Depuis
1.5

Documentation des champs

◆ $_mode

$_mode = null
protected

◆ $_rules

$_rules
protected
Valeur initiale :
= array(
'buildpreprocess' => array(),
'build' => array(),
'buildpostprocess' => array(),
'parsepreprocess' => array(),
'parse' => array(),
'parsepostprocess' => array(),
)

◆ $_vars

$_vars = array()
protected

◆ $cache

$cache = array()
protected

◆ $instances

$instances = array()
staticprotected

◆ $mode

$mode = null
protected

◆ $rules

$rules
protected
Valeur initiale :
= array(
'buildpreprocess' => array(),
'build' => array(),
'buildpostprocess' => array(),
'parsepreprocess' => array(),
'parse' => array(),
'parsepostprocess' => array(),
)

◆ $vars

$vars = array()
protected

◆ PROCESS_AFTER

const PROCESS_AFTER = 'postprocess'

◆ PROCESS_BEFORE

const PROCESS_BEFORE = 'preprocess'

◆ PROCESS_DURING

const PROCESS_DURING = ''

La documentation de cette classe a été générée à partir du fichier suivant :