Axiom (v1.2.0)

A lightweight PHP framework
axRoute Class Reference

Route Class. More...

Public Member Functions

 __construct ($template, array $params=array(), array $options=array())
 Constructor.
 match ($url)
 Tells if the Route instance match the given url.
 getParams ()
 Get the Route parameters.
 getOptions ()
 Get the Route options.
 getTemplate ()
 Get the Route template (useful for debugging)
 getPattern ()
 Get the Route PCRE pattern (useful for debugging)

Protected Member Functions

 _compileTemplate ($template)
 Compiles the pattern into a PCRE expression.

Protected Attributes

 $_template
 Template string.
 $_pattern
 PCRE pattern compiled from template.
 $_keys
 PCRE pattern keys.
 $_params
 Route parameters.
 $_options
 Route options.

Detailed Description

Route Class.

Class used to manage and to recognize routes. A route is identified by matching a pattern against the $url parameter. This pattern is provided to the Route insance by using a template, such as /{:controller}/{:action}. See axRouter::connect() for more details.

Author:
Delespierre
License:
http://www.gnu.org/licenses/lgpl.html Lesser General Public Licence version 3

Definition at line 20 of file axRoute.class.php.


Constructor & Destructor Documentation

axRoute::__construct ( template,
array $  params = array(),
array $  options = array() 
)

Constructor.

Parameters:
string$template
array$params[optional] [default array()] Parameters to populate the Route instance with
array$options[optional] [default array()] Arbitraty options array wich can be retrieved with Route::getOptions()

Definition at line 61 of file axRoute.class.php.


Member Function Documentation

axRoute::_compileTemplate ( template) [protected]

Compiles the pattern into a PCRE expression.

Todo:
Add insensitive option
Parameters:
string$template
Returns:
void

Definition at line 96 of file axRoute.class.php.

Get the Route options.

Returns:
array

Definition at line 144 of file axRoute.class.php.

Get the Route parameters.

Returns:
array

Definition at line 136 of file axRoute.class.php.

Get the Route PCRE pattern (useful for debugging)

Returns:
string

Definition at line 160 of file axRoute.class.php.

Get the Route template (useful for debugging)

Returns:
string

Definition at line 152 of file axRoute.class.php.

axRoute::match ( url)

Tells if the Route instance match the given url.

Parameters:
string$url
Returns:
boolean

Definition at line 73 of file axRoute.class.php.


Field Documentation

array axRoute::$_keys [protected]

PCRE pattern keys.

Definition at line 40 of file axRoute.class.php.

array axRoute::$_options [protected]

Route options.

Definition at line 52 of file axRoute.class.php.

array axRoute::$_params [protected]

Route parameters.

Definition at line 46 of file axRoute.class.php.

string axRoute::$_pattern [protected]

PCRE pattern compiled from template.

Definition at line 33 of file axRoute.class.php.

string axRoute::$_template [protected]

Template string.

Definition at line 26 of file axRoute.class.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables