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. |
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.
Definition at line 20 of file axRoute.class.php.
axRoute::__construct | ( | $ | template, |
array $ | params = array() , |
||
array $ | options = array() |
||
) |
Constructor.
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.
axRoute::_compileTemplate | ( | $ | template | ) | [protected] |
Compiles the pattern into a PCRE expression.
string | $template |
Definition at line 96 of file axRoute.class.php.
Get the Route PCRE pattern (useful for debugging)
Definition at line 160 of file axRoute.class.php.
Get the Route template (useful for debugging)
Definition at line 152 of file axRoute.class.php.
axRoute::match | ( | $ | url | ) |
Tells if the Route instance match the given url.
string | $url |
Definition at line 73 of file axRoute.class.php.
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.