symfony API

sfWebRequest Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.3 API OpenSearch

Packages

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

sfWebRequest class.

Inheritence

sfWebRequest  <  sfRequest

Method Summary

Methods inherited from sfRequest

extractParameters , getAttribute , getAttributeHolder , getContent , getMethod , getOptions , getParameter , getParameterHolder , hasAttribute , hasParameter , initialize , offsetExists , offsetGet , offsetSet , offsetUnset , setAttribute , setMethod , setParameter , __call , __clone , __construct

Method Details

  • addRequestParameters () Browse code

  • checkCSRFProtection () Browse code

  • (array) convertFileInformation ($taintedFiles) Browse code

    $taintedFiles An array representing uploaded file information

    Converts uploaded file array to a format following the $_GET and $POST naming convention.


    It's safe to pass an already converted array, in which case this method just returns the original array unmodified.

    returns An array of re-ordered uploaded file information

  • fixParameters () Browse code

  • fixPhpFilesArray () Browse code

  • (array) getAcceptableContentTypes () Browse code

    Gets a list of content types acceptable by the client browser

    returns Languages ordered in the user browser preferences

  • (array) getCharsets () Browse code

    Gets a list of charsets acceptable by the client browser.

    returns List of charsets in preferable order

  • (string) getContentType ($trimmed) Browse code

    $trimmed If false the full Content-Type header will be returned

    Returns the content type of the current request.

  • (mixed) getCookie ($name, $defaultValue) Browse code

    $name Cookie name
    $defaultValue Default value returned when no cookie with given name is found

    Gets a cookie value.

  • (array) getFiles ($key) Browse code

    $key A key

    Retrieves an array of files.

    returns An associative array of files

  • (string) getFormat ($mimeType) Browse code

    $mimeType The associated mime type

    Gets the format associated with the mime type.

    returns The format (null if not found)

  • (string|null) getForwardedFor () Browse code

    Returns an array containing a list of IPs, the first being the client address

    and the others the addresses of each proxy that passed the request. The address
    for the last proxy can be retrieved via getRemoteAddress().

    This method returns null if no proxy passed this request. Note that some proxies
    do not use this header, and act as if they were the client.

    returns An array of IP from the client and the proxies that passed the request, or null if no proxy was used.

  • (string) getGetParameter ($name, $default) Browse code

    $name The GET parameter name
    $default The default value

    Returns the value of a GET parameter.

    returns The GET parameter value

  • getGetParameters () Browse code

  • (string) getHost () Browse code

    Returns current host name.

  • getHttpHeader () Browse code

  • (array) getLanguages () Browse code

    Gets a list of languages acceptable by the client browser

    returns Languages ordered in the user browser preferences

  • (string) getMethodName () Browse code

    Returns request method.

  • (string) getMimeType ($format) Browse code

    $format The format

    Gets the mime type associated with the format.

    returns The associated mime type (null if not found)

  • (string) getPathInfo () Browse code

    Retrieves the path info for the current web request.

    returns Path info

  • (array) getPathInfoArray () Browse code

    Returns the array that contains all request information ($_SERVER or $_ENV).


    This information is stored in the path_info_array option.

    returns Path information

  • getPathInfoPrefix () Browse code

  • (string) getPostParameter ($name, $default) Browse code

    $name The POST parameter name
    $default The default value

    Returns the value of a POST parameter.

    returns The POST parameter value

  • getPostParameters () Browse code

  • (string) getPreferredCulture ($cultures) Browse code

    $cultures An array of ordered cultures available

    Returns the preferred culture for the current request.

    returns The preferred culture

  • (string) getReferer () Browse code

    Returns referer.

  • (string) getRelativeUrlRoot () Browse code

    Retrieves relative root url.

    returns URL

  • (string) getRemoteAddress () Browse code

    Returns the remote IP address that made the request.

    returns The remote IP address

  • (array) getRequestContext () Browse code

    Returns the request context used.

    returns An array of values representing the current request

  • (string) getRequestFormat () Browse code

    Gets the request format.


    Here is the process to determine the format:

    * format defined by the user (with setRequestFormat())
    * sf_format request parameter
    * default format from factories

    returns The request format

  • getRequestParameters () Browse code

  • (string) getScriptName () Browse code

    Returns current script name.

  • (string) getUri () Browse code

    Retrieves the uniform resource identifier for the current web request.

    returns Unified resource identifier

  • (string) getUriPrefix () Browse code

    Returns Uri prefix, including protocol, hostname and server port.

    returns Uniform resource identifier prefix

  • (string) getUrlParameter ($name, $default) Browse code

    $name The parameter name
    $default The default value

    Returns the value of a parameter passed as a URL segment.

    returns The parameter value

  • (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:

    * formats: The list of supported format and their associated mime-types
    * path_info_key: The path info key (default to PATH_INFO)
    * path_info_array: The path info array (default to SERVER)
    * relative_url_root: The relative URL root
    * http_port: The port to use for HTTP requests
    * https_port: The port to use for HTTPS requests

    returns true, if initialization completes successfully, otherwise false

    throws sfInitializationException If an error occurs while initializing this sfRequest

  • (boolean) isAbsUri () Browse code

    See if the client is using absolute uri

    returns true, if is absolute uri otherwise false

  • (boolean) isForwardedSecure () Browse code

    Returns true if the current request is forwarded from a request that is secure.

  • (bool) isMethod ($method) Browse code

    $method The method name

    Checks if the request method is the given one.

    returns true if the current method is the given one, false otherwise

  • (boolean) isSecure () Browse code

    Returns true if the current or forwarded request is secure (HTTPS protocol).

  • (bool) isXmlHttpRequest () Browse code

    Returns true if the request is a XMLHttpRequest.


    It works if your JavaScript library set an X-Requested-With HTTP header.
    Works with Prototype, Mootools, jQuery, and perhaps others.

    returns true if the request is an XMLHttpRequest, false otherwise

  • (array) parseRequestParameters () Browse code

    Parses the request parameters.


    This method notifies the request.filter_parameters event.

    returns An array of request parameters.

  • setFormat ($format, $mimeTypes) Browse code

    $format The format
    $mimeTypes The associated mime types (the preferred one must be the first as it will be used as the content type)

    Associates a format with mime types.

  • setRelativeUrlRoot ($value) Browse code

    $value Value for the url

    Sets the relative root url for the current web request.

  • setRequestFormat ($format) Browse code

    $format The request format

    Sets the request format.

  • splitHttpAcceptHeader ($header) Browse code

    $header Header to split

    Splits an HTTP header for the current web request.