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.

  • deprecated: 4.0 Use JApplicationWeb instead
  • since: 11.1

Located in /libraries/legacy/response/response.php (line 25)


	
			
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 32)
  • var: Body
  • deprecated: 4.0
  • since: 11.1
  • access: protected
static boolean $cachable = false (line 39)
  • var: Cachable
  • deprecated: 4.0
  • since: 11.1
  • access: protected
static array $headers = array() (line 46)
  • var: Headers
  • deprecated: 4.0
  • since: 11.1
  • access: protected
Methods
static allowCache (line 60)

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
  • deprecated: 4.0 Use JApplicationWeb::allowCache() instead
  • since: 11.1
  • access: public
static boolean allowCache ([boolean $allow = null])
  • boolean $allow: True to allow browser caching.
static appendBody (line 165)

Append content to the body content

  • deprecated: 4.0 Use JApplicationWeb::appendBody() instead
  • since: 11.1
  • access: public
static void appendBody (string $content)
  • string $content: The content to append to the response body.
static clearHeaders (line 105)

Clear headers.

  • deprecated: 4.0 Use JApplicationWeb::clearHeaders() instead
  • since: 11.1
  • access: public
static void clearHeaders ()
static clientEncoding (line 274)

Check, whether client supports compressed data

  • deprecated: 4.0 Use JApplicationWebClient instead
  • since: 11.1
  • access: protected
static boolean clientEncoding ()
static compress (line 214)

Compress the data

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

  • return: compressed data
  • deprecated: 4.0 Use JApplicationWeb::compress() instead
  • since: 11.1
  • access: protected
static string compress (string $data)
  • string $data: Content to compress for output.
static getBody (line 180)

Return the body content

  • return: array
  • deprecated: 4.0 Use JApplicationWeb::getBody() instead
  • 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 getHeaders (line 92)

Return array of headers.

  • deprecated: 4.0 Use JApplicationWeb::getHeaders() instead
  • since: 11.1
  • access: public
static array getHeaders ()
static prependBody (line 150)

Prepend content to the body content

  • deprecated: 4.0 Use JApplicationWeb::prependBody() instead
  • since: 11.1
  • access: public
static void prependBody (string $content)
  • string $content: The content to prepend to the response body.
static sendHeaders (line 118)

Send all headers.

  • deprecated: 4.0 Use JApplicationWeb::sendHeaders() instead
  • since: 11.1
  • access: public
static void sendHeaders ()
static setBody (line 135)

Set body content.

If body content already defined, this will replace it.

  • deprecated: 4.0 Use JApplicationWeb::setBody() instead
  • since: 11.1
  • access: public
static void setBody (string $content)
  • string $content: The content to set to the response body.
static setHeader (line 79)

Set a header.

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

  • deprecated: 4.0 Use JApplicationWeb::setHeader() instead
  • 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 toString (line 195)

Sends all headers prior to returning the string

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

Documentation generated on Tue, 19 Nov 2013 15:11:54 +0100 by phpDocumentor 1.4.3