JResponse
JResponse Class.
This class serves to provide the Joomla Platform with a common interface to access response variables. This includes header and body.
since |
1.7.0 |
---|---|
deprecated |
1.5 Use JApplicationWeb instead |
package |
Joomla.Legacy |
Methods
allowCache
Set/get cachable state for the response.
allowCache(boolean $allow = null) : boolean
If $allow is set, sets the cachable state of the response. Always returns current state.
since |
1.5 |
---|---|
deprecated |
3.2 Use JApplicationWeb::allowCache() instead |
Arguments
- $allow
boolean
True to allow browser caching.
Response
boolean
True if browser caching should be allowed
appendBody
Append content to the body content
appendBody(string $content) : void
since |
1.5 |
---|---|
deprecated |
3.2 Use JApplicationWeb::appendBody() instead |
Arguments
- $content
string
The content to append to the response body.
clearHeaders
Clear headers.
clearHeaders() : void
since |
1.5 |
---|---|
deprecated |
3.2 Use JApplicationWeb::clearHeaders() instead |
clientEncoding
Check, whether client supports compressed data
clientEncoding() : boolean
since |
1.7 |
---|---|
note |
Replaces _clientEncoding method from 1.5 |
deprecated |
3.2 Use JApplicationWebClient instead |
Response
boolean
compress
Compress the data
compress(string $data) : string
Checks the accept encoding of the browser and compresses the data before sending it to the client.
note |
Replaces _compress method from 1.5 |
---|---|
since |
1.7 |
deprecated |
3.2 Use JApplicationWeb::compress() instead |
Arguments
- $data
string
Content to compress for output.
Response
string
compressed data
getBody
Return the body content
getBody(boolean $toArray = false) : string
since |
1.5 |
---|---|
deprecated |
3.2 Use JApplicationWeb::getBody() instead |
Arguments
- $toArray
boolean
Whether or not to return the body content as an array of strings or as a single string; defaults to false.
Response
string
array
getHeaders
Return array of headers.
getHeaders() : array
since |
1.5 |
---|---|
deprecated |
3.2 Use JApplicationWeb::getHeaders() instead |
Response
array
prependBody
Prepend content to the body content
prependBody(string $content) : void
since |
1.5 |
---|---|
deprecated |
3.2 Use JApplicationWeb::prependBody() instead |
Arguments
- $content
string
The content to prepend to the response body.
sendHeaders
Send all headers.
sendHeaders() : void
since |
1.5 |
---|---|
deprecated |
3.2 Use JApplicationWeb::sendHeaders() instead |
setBody
Set body content.
setBody(string $content) : void
If body content already defined, this will replace it.
since |
1.5 |
---|---|
deprecated |
3.2 Use JApplicationWeb::setBody() instead |
Arguments
- $content
string
The content to set to the response body.
setHeader
Set a header.
setHeader(string $name, string $value, boolean $replace = false) : void
If $replace is true, replaces any headers already defined with that $name.
since |
1.5 |
---|---|
deprecated |
3.2 Use JApplicationWeb::setHeader() instead |
Arguments
- $name
string
The name of the header to set.- $value
string
The value of the header to set.- $replace
boolean
True to replace any existing headers by name.
toString
Sends all headers prior to returning the string
toString(boolean $compress = false) : string
since |
1.5 |
---|---|
deprecated |
3.2 Use JApplicationCms::toString() instead |
Arguments
- $compress
boolean
If true, compress the data
Response
string
Properties
body
Response body
since |
1.6 |
---|---|
deprecated |
3.2 |
Type(s)
array
cachable
Flag if the response is cachable
since |
1.6 |
---|---|
deprecated |
3.2 |
Type(s)
boolean
headers
Response headers
since |
1.6 |
---|---|
deprecated |
3.2 |
Type(s)
array