Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5. Some parts of this website may be subject to other licenses.

Abstract Class JRouter

Description

Class to create and parse routes

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

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 41)

The rewrite mode

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

An array of rules

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

An array of variables

  • access: protected

Inherited Variables

Inherited from JObject

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

Class constructor

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

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

Attach a build rule

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

Attach a parse rule

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

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 88)

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 179)

Get the router mode

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

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 247)

Get the router variable array

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

Function to convert a route to an internal URI

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

Get the router mode

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

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 216)

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 301)

Function to build a raw route

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

Function to build a sef route

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

Create a uri based on a full or partial url string

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

Decode route segments

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

Encode route segments

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

Function to convert a raw route to an internal URI

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

Function to convert a sef route to an internal URI

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

Process the build uri query data based on custom defined rules

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

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 Tue, 29 Jan 2008 18:50:13 +0000 by phpDocumentor 1.3.1