Support Joomla!

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2008 Open Source Matters Inc and can be used in accordance with the Joomla! Electronic Documentation License. Some parts of this website may be subject to other licenses.

 Class JResponse

Description

JResponse Class

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

  • since: 1.5

Located in /joomla/environment/response.php (line 34)

Class JResponse   (Subpackage Environment)
Method Summary
Static method static boolean allowCache ([boolean $allow = null])
Method void appendBody (string $content)
Method void clearHeaders ()
Method string|array getBody ([boolean $toArray = false])
Method array getHeaders ()
Method void prependBody (string $content)
Method void sendHeaders ()
Method void setBody (string $content)
Method void setHeader (string $name, string $value, [boolean $replace = false])
Method string toString ([boolean $compress = false])
Method string _compress (string $data)
Methods
allowCache (line 46)

Set/get cachable state for the response

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

  • return: True of browser caching should be allowed
  • since: 1.5
boolean allowCache ([boolean $allow = null])
  • boolean $allow
appendBody (line 155)

Append content to the body content

  • access: public
void appendBody (string $content)
  • string $content
clearHeaders (line 100)

Clear headers

  • access: public
void clearHeaders ()
getBody (line 167)

Return the body content

  • access: public
string|array 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
getHeaders (line 91)

Return array of headers;

  • access: public
array getHeaders ()
prependBody (line 145)

Prepend content to the body content

  • access: public
void prependBody (string $content)
  • string $content
sendHeaders (line 110)

Send all headers

  • access: public
void sendHeaders ()
setBody (line 135)

Set body content

If body content already defined, this will replace it.

  • access: public
void setBody (string $content)
  • string $content
setHeader (line 65)

Set a header

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

  • access: public
void setHeader (string $name, string $value, [boolean $replace = false])
  • string $name
  • string $value
  • boolean $replace
toString (line 187)

Sends all headers prior to returning the string

  • access: public
string toString ([boolean $compress = false])
  • boolean $compress: If true, compress the data
_compress (line 218)

Compress the data

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

  • return: compressed data
  • access: public
string _compress (string $data)
  • string $data: data

Documentation generated on Mon, 22 Sep 2008 12:12:49 +0100 by phpDocumentor 1.3.1