Class JRouter

Description

Class to create and parse routes

  • since: 11.1

Located in /libraries/joomla/application/router.php (line 25)

JObject
   |
   --JRouter
Direct descendents
Class Description
JRouterAdministrator Class to create and parse routes
JRouterSite Class to create and parse routes for the site application
Variable Summary
static array $instances
integer $mode
array $rules
array $vars
integer $_mode
array $_rules
array $_vars
Method Summary
static JRouter getInstance (string $client, [array $options = array()])
JRouter __construct ([array $options = array()])
void attachBuildRule (callback $callback)
void attachParseRule (callback $callback)
string build (string $url)
integer getMode ()
mixed getVar (string $key)
array getVars ()
array parse (JURI &$uri)
void setMode (integer $mode)
void setVar (string $key, mixed $value, [boolean $create = true])
void setVars ([array $vars = array()], [boolean $merge = true])
string _buildRawRoute (JURI &$uri)
string _buildSefRoute (JURI &$uri)
JURI _createURI (string $url)
array _decodeSegments (array $segments)
array _encodeSegments (array $segments)
boolean _parseRawRoute (JURI &$uri)
string _parseSefRoute (JURI &$uri)
void _processBuildRules (JURI &$uri)
array _processParseRules (JURI &$uri)
Variables
static array $instances = array() (line 88)
  • var: JRouter instances container.
  • since: 11.3
  • access: protected
integer $mode = null (line 33)

The rewrite mode

  • since: 11.1
  • access: protected
array $rules = array(
'build' => array(),'parse'=>array())
(line 67)

An array of rules

  • since: 11.1
  • access: protected
array $vars = array() (line 50)

An array of variables

  • since: 11.1
  • access: protected
integer $_mode = null (line 42)

The rewrite mode

  • deprecated: use $mode declare as private
  • since: 11.1
  • access: protected
array $_rules = array(
'build' => array(),'parse'=>array())
(line 79)

An array of rules

  • deprecated: use $rules declare as private
  • since: 11.1
  • access: protected
array $_vars = array() (line 59)

An array of variables

  • deprecated: use $vars declare as private
  • since: 11.1
  • access: protected

Inherited Variables

Inherited from JObject

JObject::$_errors
Methods
static method getInstance (line 120)

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

  • return: A JRouter object.
  • since: 11.1
  • access: public
static JRouter getInstance (string $client, [array $options = array()])
  • string $client: The name of the client
  • array $options: An associative array of options
Constructor __construct (line 97)

Class constructor

  • since: 11.1
  • access: public
JRouter __construct ([array $options = array()])
  • array $options: Array of options

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.
attachBuildRule (line 318)

Attach a build rule

  • since: 11.1.
  • access: public
void attachBuildRule (callback $callback)
  • callback $callback: The function to be called
attachParseRule (line 332)

Attach a parse rule

  • since: 11.1
  • access: public
void attachParseRule (callback $callback)
  • callback $callback: The function to be called.
build (line 188)

Function to convert an internal URI to a route

  • return: The absolute search engine friendly URL
  • since: 11.1
  • access: public
string build (string $url)
  • string $url: The internal URL

Redefined in descendants as:
getMode (line 218)

Get the router mode

  • since: 11.1
  • access: public
integer getMode ()
getVar (line 287)

Get a router variable

  • return: Value of the variable
  • since: 11.1
  • access: public
mixed getVar (string $key)
  • string $key: The name of the variable
getVars (line 304)

Get the router variable array

  • return: An associative array of router variables
  • since: 11.1
  • access: public
array getVars ()
parse (line 157)

Function to convert a route to an internal URI

  • since: 11.1
  • access: public
array parse (JURI &$uri)
  • JURI &$uri: The uri.

Redefined in descendants as:
setMode (line 232)

Set the router mode

  • since: 11.1
  • access: public
void setMode (integer $mode)
  • integer $mode: The routing mode.
setVar (line 248)

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

  • since: 11.1
  • access: public
void setVar (string $key, mixed $value, [boolean $create = true])
  • string $key: The name of the variable
  • mixed $value: The value of the variable
  • boolean $create: If True, the variable will be created if it doesn't exist yet
setVars (line 266)

Set the router variable array

  • since: 11.1
  • access: public
void setVars ([array $vars = array()], [boolean $merge = true])
  • array $vars: An associative array with variables
  • boolean $merge: If True, the array will be merged instead of overwritten
_buildRawRoute (line 374)

Function to build a raw route

  • return: Raw Route
  • since: 11.1
  • access: protected
string _buildRawRoute (JURI &$uri)
  • JURI &$uri: The internal URL

Redefined in descendants as:
_buildSefRoute (line 387)

Function to build a sef route

  • return: The SEF route
  • since: 11.1
  • access: protected
string _buildSefRoute (JURI &$uri)
  • JURI &$uri: The uri

Redefined in descendants as:
_createURI (line 438)

Create a uri based on a full or partial url string

  • since: 11.1
  • access: protected
JURI _createURI (string $url)
  • string $url: The URI

Redefined in descendants as:
_decodeSegments (line 497)

Decode route segments

  • return: Array of decoded route segments
  • since: 11.1
  • access: protected
array _decodeSegments (array $segments)
  • array $segments: An array of route segments
_encodeSegments (line 477)

Encode route segments

  • return: Array of encoded route segments
  • since: 11.1
  • access: protected
array _encodeSegments (array $segments)
  • array $segments: An array of route segments
_parseRawRoute (line 346)

Function to convert a raw route to an internal URI

  • since: 11.1
  • access: protected
boolean _parseRawRoute (JURI &$uri)
  • JURI &$uri: The raw route

Redefined in descendants as:
_parseSefRoute (line 360)

Function to convert a sef route to an internal URI

  • return: Internal URI
  • since: 11.1
  • access: protected
string _parseSefRoute (JURI &$uri)
  • JURI &$uri: The sef URI

Redefined in descendants as:
_processBuildRules (line 421)

Process the build uri query data based on custom defined rules

  • since: 11.1
  • access: protected
void _processBuildRules (JURI &$uri)
  • JURI &$uri: The URI

Redefined in descendants as:
_processParseRules (line 400)

Process the parsed router variables based on custom defined rules

  • return: The array of processed URI variables
  • since: 11.1
  • access: protected
array _processParseRules (JURI &$uri)
  • JURI &$uri: The URI to parse

Redefined in descendants as:

Inherited Methods

Inherited From JObject

JObject::__construct()
JObject::def()
JObject::get()
JObject::getError()
JObject::getErrors()
JObject::getProperties()
JObject::set()
JObject::setError()
JObject::setProperties()
JObject::toString()
JObject::__toString()

Documentation generated on Mon, 25 Jun 2012 13:59:19 -0500 by phpDocumentor 1.4.4