Class TUrlManager
Direct Known Sub-classes:
TUrlManager class
TUrlManager is the base class for managing URLs that can be recognized by PRADO applications. It provides the default implementation for parsing and constructing URLs. Derived classes may override constructUrl and parseUrl to provide customized URL schemes. By default, THttpRequest uses TUrlManager as its URL manager. If you want to use your customized URL manager, load your manager class as an application module and set THttpRequest::setUrlManager with the ID of your URL manager module.
Method Summary |
string
|
constructUrl
( string $serviceID, string $serviceParam, array $getItems, boolean $encodeAmpersand, boolean $encodeGetItems)
Constructs a URL that can be recognized by PRADO.
|
array
|
Parses the request URL and returns an array of input parameters.
|
Methods Inherited From TComponent |
TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()
|
Method Details |
constructUrl
public string constructUrl |
(string $serviceID , string $serviceParam , array $getItems , boolean $encodeAmpersand , boolean $encodeGetItems ) |
Constructs a URL that can be recognized by PRADO.
This method provides the actual implementation used by THttpRequest::constructUrl. Override this method if you want to provide your own way of URL formatting. If you do so, you may also need to override parseUrl so that the URL can be properly parsed. The URL is constructed as the following format: /entryscript.php?serviceID=serviceParameter&get1=value1&... If THttpRequest::setUrlFormat is 'Path', the following format is used instead: /entryscript.php/serviceID/serviceParameter/get1,value1/get2,value2...
Input |
string | $serviceID | service ID |
string | $serviceParam | service parameter |
array | $getItems | GET parameters, null if not provided |
boolean | $encodeAmpersand | whether to encode the ampersand in URL |
boolean | $encodeGetItems | whether to encode the GET parameters (their names and values) |
Output |
string
| URL |
Exception |
|
parseUrl
Parses the request URL and returns an array of input parameters.
This method is automatically invoked by THttpRequest when handling a user request. In general, this method should parse the path info part of the requesting URL and generate an array of name-value pairs according to some scheme. The current implementation deals with both 'Get' and 'Path' URL formats. You may override this method to support customized URL format.
Output |
array
| list of input parameters, indexed by parameter names |
Exception |
|
|