Class JResponse

Description

JResponse Class.

This class serves to provide the Joomla Platform with a common interface to access response variables. This includes header and body.

  • since: 11.1

Located in /libraries/joomla/environment/response.php (line 22)


	
			
Variable Summary
static array $body
static boolean $cachable
static array $headers
Method Summary
static boolean allowCache ([boolean $allow = null])
static void appendBody (string $content)
static void clearHeaders ()
static boolean clientEncoding ()
static string compress (string $data)
static string getBody ([boolean $toArray = false])
static array getHeaders ()
static void prependBody (string $content)
static void sendHeaders ()
static void setBody (string $content)
static void setHeader (string $name, string $value, [boolean $replace = false])
static string toString ([boolean $compress = false])
Variables
static array $body = array() (line 28)
  • var: Body
  • since: 11.1
  • access: protected
static boolean $cachable = false (line 34)
  • var: Cachable
  • since: 11.1
  • access: protected
static array $headers = array() (line 40)
  • var: Headers
  • since: 11.1
  • access: protected
Methods
static method allowCache (line 53)

Set/get cachable state for the response.

If $allow is set, sets the cachable state of the response. Always returns current state.

  • return: True if browser caching should be allowed
  • since: 11.1
  • access: public
static boolean allowCache ([boolean $allow = null])
  • boolean $allow: True to allow browser caching.
static method appendBody (line 184)

Append content to the body content

  • since: 11.1
  • access: public
static void appendBody (string $content)
  • string $content: The content to append to the response body.
static method clearHeaders (line 114)

Clear headers.

  • since: 11.1
  • access: public
static void clearHeaders ()
static method clientEncoding (line 312)

Check, whether client supports compressed data

  • since: 11.1
  • access: protected
static boolean clientEncoding ()
static method compress (line 258)

Compress the data

Checks the accept encoding of the browser and compresses the data before sending it to the client.

  • return: compressed data
  • since: 11.1
  • access: protected
static string compress (string $data)
  • string $data: Content to compress for output.
static method getBody (line 198)

Return the body content

  • return: array
  • since: 11.1
  • access: public
static string getBody ([boolean $toArray = false])
  • boolean $toArray: Whether or not to return the body content as an array of strings or as a single string; defaults to false.
static method getHeaders (line 102)

Return array of headers.

  • since: 11.1
  • access: public
static array getHeaders ()
static method prependBody (line 170)

Prepend content to the body content

  • since: 11.1
  • access: public
static void prependBody (string $content)
  • string $content: The content to prepend to the response body.
static method sendHeaders (line 126)

Send all headers.

  • since: 11.1
  • access: public
static void sendHeaders ()
static method setBody (line 156)

Set body content.

If body content already defined, this will replace it.

  • since: 11.1
  • access: public
static void setBody (string $content)
  • string $content: The content to set to the response body.
static method setHeader (line 76)

Set a header.

If $replace is true, replaces any headers already defined with that $name.

  • since: 11.1
  • access: public
static void setHeader (string $name, string $value, [boolean $replace = false])
  • string $name: The name of the header to set.
  • string $value: The value of the header to set.
  • boolean $replace: True to replace any existing headers by name.
static method toString (line 223)

Sends all headers prior to returning the string

  • since: 11.1
  • access: public
static string toString ([boolean $compress = false])
  • boolean $compress: If true, compress the data

Documentation generated on Mon, 25 Jun 2012 13:59:12 -0500 by phpDocumentor 1.4.4