sfRequest provides methods for manipulating client request information such
as attributes, and parameters. It is also possible to manipulate the
request method originally sent by the user.
Method Summary
-
array
extractParameters($names)
Extracts parameter values from the request.
-
mixed
getAttribute($name, $default = null)
Retrieves an attribute from the current request.
-
getAttributeHolder()
Retrieves the attributes holder.
-
string
getMethod()
Gets the request method.
-
getParameter($name, $default = null)
Retrieves a paramater for the current request.
-
getParameterHolder()
Retrieves the parameters for the current request.
-
bool
hasAttribute($name)
Indicates whether or not an attribute exist for the current request.
-
bool
hasParameter($name)
Indicates whether or not a parameter exist for the current request.
-
bool
initialize($dispatcher, $parameters = array(), $attributes = array(), $options = array())
Initializes this sfRequest.
-
setAttribute($name, $value)
Sets an attribute for the request.
-
setMethod($method)
Sets the request method.
-
setParameter($name, $value)
Sets a parameter for the current request.
-
mixed
__call($method, $arguments)
Calls methods defined via sfEventDispatcher.
-
__clone()
-
__construct($dispatcher, $parameters = array(), $attributes = array(), $options = array())
Class constructor.
Method Details
-
(array) extractParameters ($names)
Browse code
| $names |
An indexed array of parameter names to extract
|
Extracts parameter values from the request.
returns An associative array of parameters and their values. If a specified parameter doesn't exist an empty string will be returned for its value
-
(mixed) getAttribute ($name, $default = null)
Browse code
| $name |
Attribute name
|
| $default |
Default attribute value
|
Retrieves an attribute from the current request.
returns An attribute value
-
Retrieves the attributes holder.
returns The attribute holder
-
Gets the request method.
returns The request method
-
getParameter ($name, $default = null)
Browse code
| $name |
Parameter name
|
| $default |
Parameter default value
|
Retrieves a paramater for the current request.
-
Retrieves the parameters for the current request.
returns The parameter holder
-
(bool) hasAttribute ($name)
Browse code
Indicates whether or not an attribute exist for the current request.
returns true, if the attribute exists otherwise false
-
(bool) hasParameter ($name)
Browse code
Indicates whether or not a parameter exist for the current request.
returns true, if the paramater exists otherwise false
-
(bool) initialize ($dispatcher, $parameters = array(), $attributes = array(), $options = array())
Browse code
| $dispatcher |
An sfEventDispatcher instance
|
| $parameters |
An associative array of initialization parameters
|
| $attributes |
An associative array of initialization attributes
|
| $options |
An associative array of options
|
Initializes this sfRequest.
Available options: * logging: Whether to enable logging or not (false by default)
returns true, if initialization completes successfully, otherwise false
throws sfInitializationException If an error occurs while initializing this sfRequest
-
setAttribute ($name, $value)
Browse code
| $name |
Attribute name
|
| $value |
Value for the attribute
|
Sets an attribute for the request.
-
| $method |
The request method
|
Sets the request method.
throws sfException
-
setParameter ($name, $value)
Browse code
| $name |
Parameter name
|
| $value |
Parameter value
|
Sets a parameter for the current request.
-
(mixed) __call ($method, $arguments)
Browse code
| $method |
The method name
|
| $arguments |
The method arguments
|
Calls methods defined via sfEventDispatcher.
returns The returned value of the called method
throws sfException if call fails
-
-
__construct ($dispatcher, $parameters = array(), $attributes = array(), $options = array())
Browse code
| $dispatcher |
|
| $parameters |
|
| $attributes |
|
| $options |
|
Class constructor.
|