PHP Класс Prado\Web\TUrlManager

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 {@link constructUrl} and {@link parseUrl} to provide customized URL schemes. By default, {@link 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 {@link THttpRequest::setUrlManager THttpRequest.UrlManager} with the ID of your URL manager module.
С версии: 3.0.6
Автор: Qiang Xue ([email protected])
Наследование: extends Prado\TModule
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
constructUrl ( $serviceID, $serviceParam, $getItems, $encodeAmpersand, $encodeGetItems ) : string Constructs a URL that can be recognized by PRADO.
parseUrl ( ) : array Parses the request URL and returns an array of input parameters.

Описание методов

constructUrl() публичный Метод

This method provides the actual implementation used by {@link 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 {@link parseUrl} so that the URL can be properly parsed. The URL is constructed as the following format: entryscript.php?serviceID=serviceParameter&get1=value1&... If {@link THttpRequest::setUrlFormat THttpRequest.UrlFormat} is 'Path', the following format is used instead: entryscript.php/serviceID/serviceParameter/get1,value1/get2,value2... If {@link 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: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [L]
См. также: parseUrl
public constructUrl ( $serviceID, $serviceParam, $getItems, $encodeAmpersand, $encodeGetItems ) : string
Результат string URL

parseUrl() публичный Метод

This method is automatically invoked by {@link 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.
См. также: constructUrl
public parseUrl ( ) : array
Результат array list of input parameters, indexed by parameter names