spunQ_IUrlTemplate Interface Reference

Template for an http link, defined as @url in the entry point. More...

Inheritance diagram for spunQ_IUrlTemplate:

spunQ_DefaultUrlManagerUrlTemplate

List of all members.

Public Member Functions

 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.
 regexMatchToVariables (array $matches)
 Parses variables out of a regular expression match of the url.
 toHumanReadableString ()
 Converts the url template to a human-readable string.


Detailed Description

Template for an http link, defined as @url in the entry point.

Definition at line 6 of file IUrlTemplate.interface.php.


Member Function Documentation

spunQ_IUrlTemplate::getEntryPoint (  ) 

Provides the entry point this template belongs to.

Returns:
spunQ_HttpEntryPoint

Implemented in spunQ_DefaultUrlManagerUrlTemplate.

spunQ_IUrlTemplate::getLocale (  ) 

Locale this url template is for.

Returns:
spunQ_Locale

Implemented in spunQ_DefaultUrlManagerUrlTemplate.

spunQ_IUrlTemplate::getUrlParts (  ) 

Returns all parts of this url.

The parts are used to sort the templates automatically in the spunQ_UrlManager.

Returns:
array<spunQ_IUrlTemplatePart>

Implemented in spunQ_DefaultUrlManagerUrlTemplate.

spunQ_IUrlTemplate::regexMatchToVariables ( array $  matches  ) 

Parses variables out of a regular expression match of the url.

Parameters:
$matches Result of the preg_match() performed by the url router with the regular expression of this url part (acquired by call to toRegex()).
Returns:
array Mapping variable names to their value. It should contain the minimum variables set required to enter its entry point. Any missing values will be supplemented with the entry point's declared default values.
Matching the regex alone is not sufficient for the template to be able to parse a url. If the url could not be parsed (although it obviously matched the regex), the function will return false.

Implemented in spunQ_DefaultUrlManagerUrlTemplate.

spunQ_IUrlTemplate::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.

Returns:
string

Implemented in spunQ_DefaultUrlManagerUrlTemplate.

spunQ_IUrlTemplate::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 (!).

See also:
regexMatchToVariables()
Returns:
string

Implemented in spunQ_DefaultUrlManagerUrlTemplate.


The documentation for this interface was generated from the following file:

Generated on Fri Jul 1 11:12:42 2011 for spunQ3 by  doxygen 1.5.9