
Public Member Functions | |
| __construct ($localeShortName, $entryPoint) | |
| Constructor. | |
| getLocaleShortName () | |
| Provides the $shortName of the spunQ_Locale for this template. | |
| prependPart (spunQ_DefaultUrlManagerUrlTemplatePart $part) | |
| Prepends a part object to its list of url parts. | |
| toUrl ($variables) | |
| Generates a url out of this template with given variables. | |
| getVariableNames () | |
| Provides the names of all variables contained in this template. | |
| getPartForVariable ($variable) | |
| Gets the part object handling a varible. | |
| getEntryPoint () | |
| Provides the entry point this template belongs to. | |
| getUrlParts () | |
| Returns all parts of this url. | |
| getLocale () | |
| Locale this url template is for. | |
| toRegex () | |
| Provides a regular expression a url must match. | |
| toHumanReadableString () | |
| Converts the url template to a human-readable string. | |
| regexMatchToVariables (array $matches) | |
| Parses variables out of a regular expression match of the url. | |
Private Attributes | |
| $parts = array() | |
| Url parts. | |
| $localeShortName | |
| $shortName of the spunQ_Locale this template was declared for. | |
| $entryPoint | |
| spunQ_HttpEntryPoint this template was defined in. | |
Definition at line 6 of file DefaultUrlManagerUrlTemplate.class.php.
| spunQ_DefaultUrlManagerUrlTemplate::__construct | ( | $ | localeShortName, | |
| $ | entryPoint | |||
| ) |
Constructor.
| $localeShortName | $shortName of the spunQ_Locale this template was declared for. Can be an empty string to indicate default locale. | |
| $entryPoint |
Definition at line 33 of file DefaultUrlManagerUrlTemplate.class.php.
| spunQ_DefaultUrlManagerUrlTemplate::getEntryPoint | ( | ) |
Provides the entry point this template belongs to.
Implements spunQ_IUrlTemplate.
Definition at line 110 of file DefaultUrlManagerUrlTemplate.class.php.
| spunQ_DefaultUrlManagerUrlTemplate::getLocale | ( | ) |
Locale this url template is for.
Implements spunQ_IUrlTemplate.
Definition at line 124 of file DefaultUrlManagerUrlTemplate.class.php.
| spunQ_DefaultUrlManagerUrlTemplate::getLocaleShortName | ( | ) |
Provides the $shortName of the spunQ_Locale for this template.
Can be an empty string to indicate default locale.
Definition at line 44 of file DefaultUrlManagerUrlTemplate.class.php.
| spunQ_DefaultUrlManagerUrlTemplate::getPartForVariable | ( | $ | variable | ) |
Gets the part object handling a varible.
| $variable | Name of the variable to get template part for. |
NULL if the variable does not ocur within this url template. Definition at line 98 of file DefaultUrlManagerUrlTemplate.class.php.
| spunQ_DefaultUrlManagerUrlTemplate::getUrlParts | ( | ) |
Returns all parts of this url.
The parts are used to sort the templates automatically in the spunQ_UrlManager.
Implements spunQ_IUrlTemplate.
Definition at line 117 of file DefaultUrlManagerUrlTemplate.class.php.
| spunQ_DefaultUrlManagerUrlTemplate::getVariableNames | ( | ) |
Provides the names of all variables contained in this template.
Needed to check validity of variable declarations of the entry point.
Definition at line 82 of file DefaultUrlManagerUrlTemplate.class.php.
| spunQ_DefaultUrlManagerUrlTemplate::prependPart | ( | spunQ_DefaultUrlManagerUrlTemplatePart $ | part | ) |
Prepends a part object to its list of url parts.
Could have been appendPart, but the implementation in spunQ_DefaultUrlManager works from last part to first.
| $part | Part object to prepend. |
Definition at line 55 of file DefaultUrlManagerUrlTemplate.class.php.
| spunQ_DefaultUrlManagerUrlTemplate::regexMatchToVariables | ( | array $ | matches | ) |
Parses variables out of a regular expression match of the url.
| $matches | Result of the preg_match() performed by the url router with the regular expression of this url part (acquired by call to toRegex()). |
false. Implements spunQ_IUrlTemplate.
Definition at line 157 of file DefaultUrlManagerUrlTemplate.class.php.
| spunQ_DefaultUrlManagerUrlTemplate::toHumanReadableString | ( | ) |
Converts the url template to a human-readable string.
Will most likely return the string as it was declared in the @url part of the entry point.
Implements spunQ_IUrlTemplate.
Definition at line 146 of file DefaultUrlManagerUrlTemplate.class.php.
| spunQ_DefaultUrlManagerUrlTemplate::toRegex | ( | ) |
Provides a regular expression a url must match.
The regex must escape exclamation marks in addition to any other special characters. This means: if preg_quote() is used, make sure the second parameter is an exclamation mark (!).
Implements spunQ_IUrlTemplate.
Definition at line 135 of file DefaultUrlManagerUrlTemplate.class.php.
| spunQ_DefaultUrlManagerUrlTemplate::toUrl | ( | $ | variables | ) |
Generates a url out of this template with given variables.
| $variables | Array of values indexed by variable name. |
Definition at line 65 of file DefaultUrlManagerUrlTemplate.class.php.
spunQ_DefaultUrlManagerUrlTemplate::$entryPoint [private] |
spunQ_HttpEntryPoint this template was defined in.
Definition at line 25 of file DefaultUrlManagerUrlTemplate.class.php.
spunQ_DefaultUrlManagerUrlTemplate::$localeShortName [private] |
$shortName of the spunQ_Locale this template was declared for.
Can be an empty string to indicate default locale.
Definition at line 19 of file DefaultUrlManagerUrlTemplate.class.php.
spunQ_DefaultUrlManagerUrlTemplate::$parts = array() [private] |
Url parts.
Definition at line 12 of file DefaultUrlManagerUrlTemplate.class.php.
1.5.9