symfony API

sfRequest Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.4 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.4 version. Switch to:

sfRequest provides methods for manipulating client request information such

Inheritence

sfWebRequest  <  sfRequest

Method Summary

  • array extractParameters($names)
    Extracts parameter values from the request.
  • mixed getAttribute($name, $default)
    Retrieves an attribute from the current request.
  • sfParameterHolder getAttributeHolder()
    Retrieves the attributes holder.
  • string|Boolean getContent()
    Returns the content of the current request.
  • string getMethod()
    Gets the request method.
  • array getOptions()
    Returns the options.
  • getParameter($name, $default)
    Retrieves a parameter for the current request.
  • sfParameterHolder 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, $attributes, $options)
    Initializes this sfRequest.
  • Boolean offsetExists($name)
    Returns true if the request parameter exists (implements the ArrayAccess interface).
  • mixed offsetGet($name)
    Returns the request parameter associated with the name (implements the ArrayAccess interface).
  • offsetSet($offset, $value)
    Sets the request parameter associated with the offset (implements the ArrayAccess interface).
  • offsetUnset($offset)
    Removes a request parameter.
  • 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()
    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) Browse code

    $name Attribute name
    $default Default attribute value

    Retrieves an attribute from the current request.

    returns An attribute value

  • (sfParameterHolder) getAttributeHolder () Browse code

    Retrieves the attributes holder.

    returns The attribute holder

  • (string|Boolean) getContent () Browse code

    Returns the content of the current request.

    returns The content or false if none is available

  • (string) getMethod () Browse code

    Gets the request method.

    returns The request method

  • (array) getOptions () Browse code

    Returns the options.

    returns The options.

  • getParameter ($name, $default) Browse code

    $name Parameter name
    $default Parameter default value

    Retrieves a parameter for the current request.

  • (sfParameterHolder) getParameterHolder () Browse code

    Retrieves the parameters for the current request.

    returns The parameter holder

  • (bool) hasAttribute ($name) Browse code

    $name Attribute name

    Indicates whether or not an attribute exist for the current request.

    returns true, if the attribute exists otherwise false

  • (bool) hasParameter ($name) Browse code

    $name Parameter name

    Indicates whether or not a parameter exist for the current request.

    returns true, if the parameter exists otherwise false

  • (bool) initialize ($dispatcher, $parameters, $attributes, $options) 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

  • (Boolean) offsetExists ($name) Browse code

    $name The name of the request parameter

    Returns true if the request parameter exists (implements the ArrayAccess interface).

    returns true if the request parameter exists, false otherwise

  • (mixed) offsetGet ($name) Browse code

    $name The offset of the value to get

    Returns the request parameter associated with the name (implements the ArrayAccess interface).

    returns The request parameter if exists, null otherwise

  • offsetSet ($offset, $value) Browse code

    $offset The parameter name
    $value The parameter value

    Sets the request parameter associated with the offset (implements the ArrayAccess interface).

  • offsetUnset ($offset) Browse code

    $offset The parameter name

    Removes a request parameter.

  • setAttribute ($name, $value) Browse code

    $name Attribute name
    $value Value for the attribute

    Sets an attribute for the request.

  • setMethod ($method) Browse code

    $method The request method

    Sets the request method.

    throws sfException - If the specified request method is invalid

  • 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

  • __clone () Browse code

  • __construct () Browse code

    Class constructor.