JResponse

JResponse Class.

deprecated

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
static deprecated

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

booleanTrue to allow browser caching.

Response

booleanTrue if browser caching should be allowed

appendBody

Append content to the body content

appendBody(string $content) : void
static deprecated
since

1.5

deprecated

3.2 Use JApplicationWeb::appendBody() instead

Arguments

$content

stringThe content to append to the response body.

clearHeaders

Clear headers.

clearHeaders() : void
static deprecated
since

1.5

deprecated

3.2 Use JApplicationWeb::clearHeaders() instead

clientEncoding

Check, whether client supports compressed data

clientEncoding() : boolean
static deprecated
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
static deprecated

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

stringContent to compress for output.

Response

stringcompressed data

getBody

Return the body content

getBody(boolean $toArray = false) : string
static deprecated
since

1.5

deprecated

3.2 Use JApplicationWeb::getBody() instead

Arguments

$toArray

booleanWhether or not to return the body content as an array of strings or as a single string; defaults to false.

Response

stringarray

getHeaders

Return array of headers.

getHeaders() : array
static deprecated
since

1.5

deprecated

3.2 Use JApplicationWeb::getHeaders() instead

Response

array

prependBody

Prepend content to the body content

prependBody(string $content) : void
static deprecated
since

1.5

deprecated

3.2 Use JApplicationWeb::prependBody() instead

Arguments

$content

stringThe content to prepend to the response body.

sendHeaders

Send all headers.

sendHeaders() : void
static deprecated
since

1.5

deprecated

3.2 Use JApplicationWeb::sendHeaders() instead

setBody

Set body content.

setBody(string $content) : void
static deprecated

If body content already defined, this will replace it.

since

1.5

deprecated

3.2 Use JApplicationWeb::setBody() instead

Arguments

$content

stringThe content to set to the response body.

setHeader

Set a header.

setHeader(string $name, string $value, boolean $replace = false) : void
static deprecated

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

since

1.5

deprecated

3.2 Use JApplicationWeb::setHeader() instead

Arguments

$name

stringThe name of the header to set.

$value

stringThe value of the header to set.

$replace

booleanTrue to replace any existing headers by name.

toString

Sends all headers prior to returning the string

toString(boolean $compress = false) : string
static deprecated
since

1.5

deprecated

3.2 Use JApplicationCms::toString() instead

Arguments

$compress

booleanIf true, compress the data

Response

string

Properties

body

Response body

static deprecated
since

1.6

deprecated

3.2

Type(s)

array

cachable

Flag if the response is cachable

static deprecated
since

1.6

deprecated

3.2

Type(s)

boolean

headers

Response headers

static deprecated
since

1.6

deprecated

3.2

Type(s)

array