Implements interfaces:
THttpRequest class
THttpRequest provides storage and access scheme for user request sent via HTTP. It also encapsulates a uniform way to parse and construct URLs.
User post data can be retrieved from THttpRequest by using it like an associative array. For example, to test if a user supplies a variable named 'param1', you can use,
To get the value of 'param1', use,
- if(isset($request['param1'])) ...
- // equivalent to:
- // if($request->contains('param1')) ...
To traverse the user post data, use
- $value=$request['param1'];
- // equivalent to:
- // $value=$request->itemAt('param1');
Note, POST and GET variables are merged together in THttpRequest. If a variable name appears in both POST and GET data, then POST data takes precedence.
- foreach($request as $name=>$value) ...
To construct a URL that can be recognized by Prado, use constructUrl(). THttpRequest also provides the cookies sent by the user, user information such as his browser capabilities, accepted languages, etc. Currently, THttpRequest recognizes the following URL format:
where ServiceID is as defined in the application configuration (e.g. the default page service's service ID is 'page'). Therefore, your GET variable names should not conflict with the service IDs that your application supports.
- /index.php?ServiceID=ServiceParameter
By default, THttpRequest is registered with TApplication as the request module. It can be accessed via TApplication::getRequest().
Located in /Web/THttpRequest.php (line 60)
TComponent | --TApplicationComponent | --THttpRequest
Adds an item into the request.
Note, if the specified key already exists, the old value will be overwritten.
Removes all items in the request.
Constructs a URL that is recognizable by Prado.
You may override this method to provide your own way of URL formatting. The URL is constructed as the following format: /entryscript.php?serviceID=serviceParameter&get1=value1&...
Returns an iterator for traversing the items in the list.
This method is required by the interface IteratorAggregate.
Returns a list of user preferred languages.
The languages are returned as an array. Each array element represents a single language preference. The languages are ordered according to user preferences. The first language is the most preferred.
Initializes the module.
This method is required by IModule and is invoked by application.
Returns the item with the specified key.
This method is exactly the same as offsetGet.
Returns whether there is an element at the specified offset.
This method is required by the interface ArrayAccess.
Returns the element at the specified offset.
This method is required by the interface ArrayAccess.
Sets the element at the specified offset.
This method is required by the interface ArrayAccess.
Unsets the element at the specified offset.
This method is required by the interface ArrayAccess.
Removes an item from the request by its key.
Resolves the requested servie.
This method implements a URL-based service resolution. A URL in the format of /index.php?sp=serviceID.serviceParameter will be resolved with the serviceID and the serviceParameter. You may override this method to provide your own way of service resolution.
Sets the requested service ID.
Sets the requested service parameter.
Sets the format of URLs constructed and interpretted by the request module.
A 'Get' URL format is like index.php?name1=value1&name2=value2 while a 'Path' URL format is like index.php/name1,value1/name2,value. Changing the UrlFormat will affect constructUrl and how GET variables are parsed.
Strips slashes from input data.
This method is applied when magic quotes is enabled.
Inherited From TApplicationComponent
TApplicationComponent::getApplication()
TApplicationComponent::getRequest()
TApplicationComponent::getResponse()
TApplicationComponent::getService()
TApplicationComponent::getSession()
TApplicationComponent::getUser()
TApplicationComponent::publishAsset()
TApplicationComponent::publishFilePath()
Inherited From TComponent
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
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 Sun, 04 Jun 2006 18:59:30 -0400 by phpDocumentor 1.3.0RC4