symfony API

sfWebResponse Class

« Back to API menu

1.0 API OpenSearch

Packages

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

sfWebResponse class.

Inheritence

sfWebResponse  <  sfResponse

Method Summary

  • setHttpHeader($name, $value, $replace = true)
    Sets a HTTP header.
  • array getContentType()
    Gets response content type.
  • addVaryHttpHeader($header)
    Adds vary to a http header.
  • string getHttpHeaders()
    Retrieves HTTP headers from the current web response.
  • boolean isHeaderOnly()
    Returns if the response must only consist of HTTP headers.
  • addMeta($key, $value, $replace = true, $escape = true)
    Adds a meta header to the current web response.
  • shutdown()
    Executes the shutdown procedure.
  • setCookie($name, $value, $expire = null, $path = &apos;/&apos;, $domain = &apos;&apos;, $secure = false, $httpOnly = false)
    Sets a cookie.
  • sendContent()
    Send content for the current web response.
  • boolean initialize((sfContext) $context, $parameters = array())
    Initializes this sfWebResponse.
  • addHttpMeta($key, $value, $replace = true)
    Adds meta headers to the current web response.
  • addStylesheet($css, $position = &apos;&apos;, $options = array())
    Adds an stylesheet to the current web response.
  • string getHttpMetas()
    Retrieves meta headers for the current web response.
  • string getTitle()
    Retrieves title for the current web response.
  • string getDate($timestamp, $type = &apos;rfc1123&apos;)
    Retrieves a formated date.
  • setStatusCode($code, $name = null)
    Sets response status code.
  • boolean hasHttpHeader($name)
    Has a HTTP header.
  • string normalizeHeaderName($name)
    Retrieves a normalized Header.
  • addJavascript($js, $position = &apos;&apos;)
    Adds javascript code to the current web response.
  • addCacheControlHttpHeader($name, $value = null)
    Adds an control cache http header.
  • string getStylesheets($position = &apos;&apos;)
    Retrieves stylesheets for the current web response.
  • array getMetas()
    Retrieves all meta headers for the current web response.
  • string getStatusCode()
    Retrieves status code for the current web response.
  • setTitle($title, $escape = true)
    Sets title for the current web response.
  • __wakeup()
    Reconstructs any result that web response instance needs.
  • string getJavascripts($position = &apos;&apos;)
    Retrieves javascript code from the current web response.
  • sendHttpHeaders()
    Send HTTP headers and cookies.
  • array getHttpHeader($name, $default = null)
    Gets HTTP header current value.
  • setContentType($value)
    Sets response content type.
  • mergeProperties((sfResponse) $response)
    Copies a propertie to a new one.
  • array __sleep()
    Retrieves all objects handlers for the current web response.
  • setHeaderOnly($value = true)
    Sets if the response consist of just HTTP headers.
  • array getCookies()
    Retrieves cookies from the current web response.
  • clearHttpHeaders()
    Cleans HTTP headers from the current web response.

Methods inherited from sfResponse

setContext , __call , shutdown , newInstance , hasParameter , getParameter , sendContent , initialize , getContent , getContext , getParameterHolder , setParameter , setContent

Method Details

  • setHttpHeader ($name, $value, $replace = true) Browse code

    $name HTTP header name
    $value Value
    $replace Replace for the value

    Sets a HTTP header.

  • (array) getContentType () Browse code

    Gets response content type.

  • addVaryHttpHeader ($header) Browse code

    $header HTTP header

    Adds vary to a http header.

  • (string) getHttpHeaders () Browse code

    Retrieves HTTP headers from the current web response.

    returns HTTP headers

  • (boolean) isHeaderOnly () Browse code

    Returns if the response must only consist of HTTP headers.

    returns returns true if, false otherwise

  • addMeta ($key, $value, $replace = true, $escape = true) Browse code

    $key Name of the header
    $value Meta header to be set
    $replace true if it's replaceable
    $escape true for escaping the header

    Adds a meta header to the current web response.

  • shutdown () Browse code

    Executes the shutdown procedure.

  • setCookie ($name, $value, $expire = null, $path = '/', $domain = '', $secure = false, $httpOnly = false) Browse code

    $name HTTP header name
    $value Value for the cookie
    $expire Cookie expiration period
    $path Path
    $domain Domain name
    $secure If secure
    $httpOnly If uses only HTTP

    Sets a cookie.

    throws sfException If fails to set the cookie

  • sendContent () Browse code

    Send content for the current web response.

  • (boolean) initialize ((sfContext) $context, $parameters = array()) Browse code

    $context A sfContext instance
    $parameters

    Initializes this sfWebResponse.

    returns true, if initialization completes successfully, otherwise false

    throws sfInitializationException If an error occurs while initializing this Response

  • addHttpMeta ($key, $value, $replace = true) Browse code

    $key Key to replace
    $value Value for the replacement
    $replace Replace or not

    Adds meta headers to the current web response.

  • addStylesheet ($css, $position = '', $options = array()) Browse code

    $css Stylesheet
    $position Position
    $options Stylesheet options

    Adds an stylesheet to the current web response.

  • (string) getHttpMetas () Browse code

    Retrieves meta headers for the current web response.

    returns Meta headers

  • (string) getTitle () Browse code

    Retrieves title for the current web response.

    returns Title

  • (string) getDate ($timestamp, $type = 'rfc1123') Browse code

    $timestamp Timestamp
    $type Format type

    Retrieves a formated date.

    returns Formated date

  • setStatusCode ($code, $name = null) Browse code

    $code HTTP status code
    $name HTTP status text

    Sets response status code.

  • (boolean) hasHttpHeader ($name) Browse code

    $name

    Has a HTTP header.

  • (string) normalizeHeaderName ($name) Browse code

    $name Header name

    Retrieves a normalized Header.

    returns Normalized header

  • addJavascript ($js, $position = '') Browse code

    $js Javascript code
    $position Directory delimiter

    Adds javascript code to the current web response.

  • addCacheControlHttpHeader ($name, $value = null) Browse code

    $name HTTP header
    $value Value for the http header

    Adds an control cache http header.

  • (string) getStylesheets ($position = '') Browse code

    $position Position

    Retrieves stylesheets for the current web response.

    returns Stylesheets

  • (array) getMetas () Browse code

    Retrieves all meta headers for the current web response.

    returns List of meta headers

  • (string) getStatusCode () Browse code

    Retrieves status code for the current web response.

    returns Status code

  • setTitle ($title, $escape = true) Browse code

    $title Title name
    $escape true, for escaping the title

    Sets title for the current web response.

  • __wakeup () Browse code

    Reconstructs any result that web response instance needs.

  • (string) getJavascripts ($position = '') Browse code

    $position Directory delimiter

    Retrieves javascript code from the current web response.

    returns Javascript code

  • sendHttpHeaders () Browse code

    Send HTTP headers and cookies.

  • (array) getHttpHeader ($name, $default = null) Browse code

    $name
    $default

    Gets HTTP header current value.

  • setContentType ($value) Browse code

    $value Content type

    Sets response content type.

  • mergeProperties ((sfResponse) $response) Browse code

    $response Response instance

    Copies a propertie to a new one.

  • (array) __sleep () Browse code

    Retrieves all objects handlers for the current web response.

    returns Objects instance

  • setHeaderOnly ($value = true) Browse code

    $value

    Sets if the response consist of just HTTP headers.

  • (array) getCookies () Browse code

    Retrieves cookies from the current web response.

    returns Cookies

  • clearHttpHeaders () Browse code

    Cleans HTTP headers from the current web response.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.