Support Joomla!

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2008 Open Source Matters Inc and can be used in accordance with the Joomla! Electronic Documentation License. Some parts of this website may be subject to other licenses.

Abstract Class JRouter

Description

Class to create and parse routes

  • since: 1.5
  • abstract:

Located in /joomla/application/router.php (line 32)

Class JObject   (Subpackage Base)

Abstract class JRouter   (Subpackage Application)
Variable Summary
Variable integer $_mode
Variable array $_rules
Variable array $_vars
Method Summary
Constructor JRouter __construct ([ $options = array()])
Method void attachBuildRule (callback $callback)
Method void attachParseRule (callback $callback)
Method string &build ( $url, string $string)
Method JRouter &getInstance (string $client, [array $options = array()])
Method void getMode ()
Method void getVar (string $key)
Method array getVars ()
Method void parse ( &$uri)
Method void setMode ( $mode)
Method void setVar (string $key, mixed $value, [boolean $create = true])
Method void setVars ([array $vars = array()], [ $merge = true], boolean $create)
Abstract method void _buildRawRoute ( &$uri)
Abstract method void _buildSefRoute ( &$uri)
Method JURI &_createURI ( $url)
Method array _decodeSegments (array $segments)
Method array _encodeSegments (array $segments)
Abstract method void _parseRawRoute ( &$uri)
Abstract method void _parseSefRoute ( &$uri)
Abstract method void _processBuildRules ( &$uri)
Abstract method void _processParseRules ( &$uri)
Variables
integer $_mode = null (line 40)

The rewrite mode

  • access: protected
array $_rules = array(
'build' => array(),'parse'=>array())
(line 56)

An array of rules

  • access: protected
array $_vars = array() (line 48)

An array of variables

  • access: protected

Inherited Variables

Inherited from JObject

Variable JObject::$_errors
Methods
Constructor __construct (line 66)

Class constructor

  • access: public
JRouter __construct ([ $options = array()])
  • $options

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

Attach a build rule

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

Attach a parse rule

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

Function to convert an internal URI to a route

  • return: The absolute search engine friendly URL
string &build ( $url, string $string)
  • string $string: The internal URL
  • $url
getInstance (line 87)

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

This method must be invoked as:

  $menu = &JRouter::getInstance();

  • return: A router object.
  • access: public
JRouter &getInstance (string $client, [array $options = array()])
  • string $client: The name of the client
  • array $options: An associative array of options
getMode (line 178)

Get the router mode

  • access: public
void getMode ()
getVar (line 231)

Get a router variable

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

Get the router variable array

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

Function to convert a route to an internal URI

  • access: public
void parse ( &$uri)
  • &$uri
setMode (line 187)

Get the router mode

  • access: public
void setMode ( $mode)
  • $mode
setVar (line 199)

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

  • 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 215)

Set the router variable array

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

Function to build a raw route

  • access: protected
  • abstract:
void _buildRawRoute ( &$uri)
  • &$uri
_buildSefRoute (line 311)

Function to build a sef route

  • access: protected
  • abstract:
void _buildSefRoute ( &$uri)
  • &$uri
_createURI (line 352)

Create a uri based on a full or partial url string

  • return: A JURI object
  • access: protected
JURI &_createURI ( $url)
  • $url
_decodeSegments (line 407)

Decode route segments

  • access: protected
array _decodeSegments (array $segments)
  • array $segments: An array of route segments
_encodeSegments (line 390)

Encode route segments

  • access: protected
array _encodeSegments (array $segments)
  • array $segments: An array of route segments
_parseRawRoute (line 278)

Function to convert a raw route to an internal URI

  • access: protected
  • abstract:
void _parseRawRoute ( &$uri)
  • &$uri
_parseSefRoute (line 289)

Function to convert a sef route to an internal URI

  • access: protected
  • abstract:
void _parseSefRoute ( &$uri)
  • &$uri
_processBuildRules (line 339)

Process the build uri query data based on custom defined rules

  • access: protected
  • abstract:
void _processBuildRules ( &$uri)
  • &$uri
_processParseRules (line 322)

Process the parsed router variables based on custom defined rules

  • access: protected
  • abstract:
void _processParseRules ( &$uri)
  • &$uri

Inherited Methods

Inherited From JObject

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

Documentation generated on Fri, 01 May 2009 14:08:36 +0100 by phpDocumentor 1.3.1