
Public Member Functions | |
| generateRegex (spunQ_Type $type, spunQ_Map $options, spunQ_Locale $locale, &$greedy, spunQ_DefaultUrlManagerUrlTemplatePart $urlPart=NULL) | |
| Generates a regular expression that will match part of a url. | |
| generateUrlPart (spunQ_Type $type, spunQ_Map $options, spunQ_Locale $locale, $value, spunQ_DefaultUrlManagerUrlTemplatePart $urlPart=NULL) | |
| Creates part of a url using a variable. | |
| regexMatchToVariable (spunQ_Type $type, spunQ_Map $options, spunQ_Locale $locale, $match, &$parsedValue, spunQ_DefaultUrlManagerUrlTemplatePart $urlPart=NULL) | |
| Reverse operation to generateUrlPart(). | |
Does the job of the url manager for all variables of the type this handler is for (i.e. the integer handler will handle all integer variables.)
Default implementations are singletons for performance reasons and to reduce memory consumption of the framework. Creating type handlers for every part of every template of every entry point would lead to hundreds of very sparely used objects.
Definition at line 12 of file IDefaultUrlManagerTypeHandler.interface.php.
| spunQ_IDefaultUrlManagerTypeHandler::generateRegex | ( | spunQ_Type $ | type, | |
| spunQ_Map $ | options, | |||
| spunQ_Locale $ | locale, | |||
| &$ | greedy, | |||
| spunQ_DefaultUrlManagerUrlTemplatePart $ | urlPart = NULL | |||
| ) |
Generates a regular expression that will match part of a url.
The regex will adhere to the specifications of spunQ_IUrlTemplate::toRegex().
| $type | The concreate type to process. | |
| $options | Options to the type. Will most commonly be an empty map. The UserType handler might pass member options to other handlers, though. | |
| $locale | Locale to create regex for. | |
| $greedy | Boolean value: whether the generated regular expression should be greedy. If a greedy value regex is generated, the parameter should be set to false. | |
| $urlPart | An optional url part to create the regex for. Some type handlers (such as the UserType handler) might take the variable definition into account (think of member references, for example). |
Implemented in spunQ_DefaultUrlManagerArrayTypeHandler, spunQ_DefaultUrlManagerBooleanTypeHandler, spunQ_DefaultUrlManagerStringTypeHandler, and spunQ_DefaultUrlManagerUserTypeHandler.
| spunQ_IDefaultUrlManagerTypeHandler::generateUrlPart | ( | spunQ_Type $ | type, | |
| spunQ_Map $ | options, | |||
| spunQ_Locale $ | locale, | |||
| $ | value, | |||
| spunQ_DefaultUrlManagerUrlTemplatePart $ | urlPart = NULL | |||
| ) |
Creates part of a url using a variable.
| $type | The concreate type to process. | |
| $options | Options to the type. Will most commonly be an empty map. The UserType handler might pass member options to other handlers, though. | |
| $locale | Locale to create string for. | |
| $value | The value to process. Evidently, the value should be of the type this handler is for. | |
| $urlPart | An optional url part to process for. Some type handlers (such as the UserType handler) might take the variable definition into account (think of member references, for example). |
Implemented in spunQ_DefaultUrlManagerArrayTypeHandler, spunQ_DefaultUrlManagerBooleanTypeHandler, spunQ_DefaultUrlManagerStringTypeHandler, and spunQ_DefaultUrlManagerUserTypeHandler.
| spunQ_IDefaultUrlManagerTypeHandler::regexMatchToVariable | ( | spunQ_Type $ | type, | |
| spunQ_Map $ | options, | |||
| spunQ_Locale $ | locale, | |||
| $ | match, | |||
| &$ | parsedValue, | |||
| spunQ_DefaultUrlManagerUrlTemplatePart $ | urlPart = NULL | |||
| ) |
Reverse operation to generateUrlPart().
Creates a variable out of a string passed through the url.
| $type | The concreate type to process. | |
| $options | Options to the type. Will most commonly be an empty map. The UserType handler might pass member options to other handlers, though. | |
| $locale | Locale the request is in. | |
| $match | String that matched the regular expression returned by generateRegex(). | |
| $parsedValue | Out-parameter indicating whether the value could be parsed successfully. | |
| $urlPart | An optional url part to process for. Some type handlers (such as the UserType handler) might take the variable definition into account (think of member references, for example). |
Implemented in spunQ_DefaultUrlManagerArrayTypeHandler, spunQ_DefaultUrlManagerBooleanTypeHandler, spunQ_DefaultUrlManagerStringTypeHandler, and spunQ_DefaultUrlManagerUserTypeHandler.
1.5.9