PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TUrlManager

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 TUrlManager::constructUrl() and TUrlManager::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 THttpRequest.UrlManager with the ID of your URL manager module.

TComponent
Extended by TApplicationComponent
Extended by TModule implements IModule
Extended by TUrlManager

Direct known subclasses

TUrlMapping
Package: System\Web
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Version: $Id $
Since: 3.0.6
Located at Web/TUrlManager.php
Methods summary
public string
# constructUrl( string $serviceID, string $serviceParam, array $getItems, boolean $encodeAmpersand, boolean $encodeGetItems )

Constructs a URL that can be recognized by PRADO.

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 TUrlManager::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 THttpRequest.UrlFormat is 'Path', the following format is used instead: /entryscript.php/serviceID/serviceParameter/get1,value1/get2,value2... If THttpRequest::setUrlFormat THttpRequest.UrlFormat is 'HiddenPath', then entryscript.php will be hidden and the following format is used instead: /serviceID/serviceParameter/get1,value1/get2,value2... In order to use the 'HiddenPath' format you need proper url rewrite configuration; here's an example for Apache's .htaccess: <cdde> Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [L] </code>

Parameters

$serviceID
string
service ID
$serviceParam
string
service parameter
$getItems
array
GET parameters, null if not provided
$encodeAmpersand
boolean
whether to encode the ampersand in URL
$encodeGetItems
boolean
whether to encode the GET parameters (their names and values)

Returns

string
URL

See

TUrlManager::parseUrl()
public array
# parseUrl( )

Parses the request URL and returns an array of input parameters. This method is automatically invoked by THttpRequest when handling a user request.

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.

Returns

array
list of input parameters, indexed by parameter names

See

TUrlManager::constructUrl()
Methods inherited from TModule
getID(), init(), setID()
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __construct(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO