Class JRouter

Description

Class to create and parse routes

  • since: 1.5

Located in /libraries/cms/router/router.php (line 25)


	
			
Direct descendents
Class Description
 class JRouterInstallation Class to create and parse routes
 class JRouterAdministrator Class to create and parse routes
 class 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)
 string buildRawRoute (JUri &$uri)
 string buildSefRoute (JUri &$uri)
 JUri createURI (string $url)
 array decodeSegments (array $segments)
 array encodeSegments (array $segments)
 integer getMode ()
 mixed getVar (string $key)
 array getVars ()
 array parse (JUri &$uri)
 boolean parseRawRoute (JUri &$uri)
 string parseSefRoute (JUri &$uri)
 void processBuildRules (JUri &$uri)
 array processParseRules (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 90)

JRouter instances container.

  • since: 1.7
  • access: protected
integer $mode = null (line 33)

The rewrite mode

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

An array of rules

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

An array of variables

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

The rewrite mode

  • deprecated: 4.0 Will convert to $mode
  • since: 1.5
  • access: protected
array $_rules = array(
'build' => array(),'parse'=>array())
(line 79)

An array of rules

  • deprecated: 4.0 Will convert to $rules
  • since: 1.5
  • access: protected
array $_vars = array() (line 59)

An array of variables

  • deprecated: 4.0 Will convert to $vars
  • since: 1.5
  • access: protected
Methods
static getInstance (line 123)

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

  • return: A JRouter object.
  • throws: RuntimeException
  • since: 1.5
  • 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 99)

Class constructor

  • since: 1.5
  • access: public
JRouter __construct ([array $options = array()])
  • array $options: Array of options
attachBuildRule (line 331)

Attach a build rule

  • since: 1.5
  • access: public
void attachBuildRule (callback $callback)
  • callback $callback: The function to be called
attachParseRule (line 345)

Attach a parse rule

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

Function to convert an internal URI to a route

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

Redefined in descendants as:
buildRawRoute (line 432)

Function to build a raw route

  • return: Raw Route
  • since: 3.2
  • access: protected
string buildRawRoute (JUri &$uri)
  • JUri &$uri: The internal URL
buildSefRoute (line 460)

Function to build a sef route

  • return: The SEF route
  • since: 3.2
  • access: protected
string buildSefRoute (JUri &$uri)
  • JUri &$uri: The uri

Redefined in descendants as:
createURI (line 556)

Create a uri based on a full or partial url string

  • since: 3.2
  • access: protected
JUri createURI (string $url)
  • string $url: The URI

Redefined in descendants as:
decodeSegments (line 647)

Decode route segments

  • return: Array of decoded route segments
  • since: 3.2
  • access: protected
array decodeSegments (array $segments)
  • array $segments: An array of route segments
encodeSegments (line 611)

Encode route segments

  • return: Array of encoded route segments
  • since: 3.2
  • access: protected
array encodeSegments (array $segments)
  • array $segments: An array of route segments
getMode (line 229)

Get the router mode

  • since: 1.5
  • access: public
integer getMode ()
getVar (line 298)

Get a router variable

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

Get the router variable array

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

Function to convert a route to an internal URI

  • since: 1.5
  • access: public
array parse (JUri &$uri)
  • JUri &$uri: The uri.

Redefined in descendants as:
parseRawRoute (line 374)

Function to convert a raw route to an internal URI

  • since: 3.2
  • access: protected
boolean parseRawRoute (JUri &$uri)
  • JUri &$uri: The raw route

Redefined in descendants as:
parseSefRoute (line 403)

Function to convert a sef route to an internal URI

  • return: Internal URI
  • since: 3.2
  • access: protected
string parseSefRoute (JUri &$uri)
  • JUri &$uri: The sef URI

Redefined in descendants as:
processBuildRules (line 524)

Process the build uri query data based on custom defined rules

  • since: 3.2
  • access: protected
void processBuildRules (JUri &$uri)
  • JUri &$uri: The URI

Redefined in descendants as:
processParseRules (line 488)

Process the parsed router variables based on custom defined rules

  • return: The array of processed URI variables
  • since: 3.2
  • access: protected
array processParseRules (JUri &$uri)
  • JUri &$uri: The URI to parse

Redefined in descendants as:
setMode (line 243)

Set the router mode

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

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

  • since: 1.5
  • 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 277)

Set the router variable array

  • since: 1.5
  • 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 418)

Function to build a raw route

  • return: Raw Route
  • deprecated: 4.0 Use buildRawRoute() instead
  • since: 1.5
  • access: protected
string _buildRawRoute (JUri &$uri)
  • JUri &$uri: The internal URL
_buildSefRoute (line 446)

Function to build a sef route

  • return: The SEF route
  • deprecated: 4.0 Use buildSefRoute() instead
  • since: 1.5
  • access: protected
string _buildSefRoute (JUri &$uri)
  • JUri &$uri: The uri

Redefined in descendants as:
_createURI (line 542)

Create a uri based on a full or partial url string

  • deprecated: 4.0 Use createURI() instead
  • since: 1.5
  • access: protected
JUri _createURI (string $url)
  • string $url: The URI
_decodeSegments (line 633)

Decode route segments

  • return: Array of decoded route segments
  • deprecated: 4.0 Use decodeSegments() instead
  • since: 1.5
  • access: protected
array _decodeSegments (array $segments)
  • array $segments: An array of route segments
_encodeSegments (line 597)

Encode route segments

  • return: Array of encoded route segments
  • deprecated: 4.0 Use encodeSegments() instead
  • since: 1.5
  • access: protected
array _encodeSegments (array $segments)
  • array $segments: An array of route segments
_parseRawRoute (line 360)

Function to convert a raw route to an internal URI

  • deprecated: 4.0 Use parseRawRoute() instead
  • since: 1.5
  • access: protected
boolean _parseRawRoute (JUri &$uri)
  • JUri &$uri: The raw route
_parseSefRoute (line 389)

Function to convert a sef route to an internal URI

  • return: Internal URI
  • deprecated: 4.0 Use parseSefRoute() instead
  • since: 1.5
  • access: protected
string _parseSefRoute (JUri &$uri)
  • JUri &$uri: The sef URI
_processBuildRules (line 510)

Process the build uri query data based on custom defined rules

  • deprecated: 4.0 Use processBuildRules() instead
  • since: 1.5
  • access: protected
void _processBuildRules (JUri &$uri)
  • JUri &$uri: The URI
_processParseRules (line 474)

Process the parsed router variables based on custom defined rules

  • return: The array of processed URI variables
  • deprecated: 4.0 Use processParseRules() instead
  • since: 1.5
  • access: protected
array _processParseRules (JUri &$uri)
  • JUri &$uri: The URI to parse

Documentation generated on Tue, 19 Nov 2013 15:12:28 +0100 by phpDocumentor 1.4.3