## Class TUrlManager

Description

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.

- since: 3.0.6
- version: $Id $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/TUrlManager.php (line 33)

    TComponent
       |
       --TApplicationComponent
          |
          --TModule
             |
             --TUrlManager

Direct descendents

Class | Description
--- | ---
TUrlMapping | TUrlMapping Class

Method Summary
string constructUrl (string $serviceID, string $serviceParam, array $getItems, boolean $encodeAmpersand, boolean $encodeGetItems)
array parseUrl ()
Methods
constructUrl (line 55)

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

- return: URL
- access: public
- see: TUrlManager::parseUrl()

string constructUrl (string $serviceID, string $serviceParam, array $getItems, boolean $encodeAmpersand, boolean $encodeGetItems)

- 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)

Redefined in descendants as:

- TUrlMapping::constructUrl() : Constructs a URL that can be recognized by PRADO.

parseUrl (line 109)

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.

- return: list of input parameters, indexed by parameter names
- access: public
- see: TUrlManager::constructUrl()

array parseUrl ()

Redefined in descendants as:

- TUrlMapping::parseUrl() : Parses the request URL and returns an array of input parameters.

#### Inherited Methods

Inherited From TModule

> TModule::getID()
> TModule::init()
> TModule::setID()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

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()

Documentation generated on Mon, 21 Apr 2008 11:36:39 -0400 by phpDocumentor 1.3.0RC4