class JResponse


Located at : UKNOWVA_ROOT/libraries/joomla/environment/response.php

JResponse Class.

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

Methods

static boolean
allowCache(boolean $allow = null)

Set/get cachable state for the response.

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

Set a header.

static array
getHeaders()

Return array of headers.

static void
clearHeaders()

Clear headers.

static void
sendHeaders()

Send all headers.

static void
setBody(string $content)

Set body content.

static void
prependBody(string $content)

Prepend content to the body content

static void
appendBody(string $content)

Append content to the body content

static string
getBody(boolean $toArray = false)

Return the body content

static string
toString(boolean $compress = false)

Sends all headers prior to returning the string

Details

at line 52
static boolean allowCache(boolean $allow = null)

Set/get cachable state for the response.

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

Parameters

boolean $allow

Return Value

boolean True of browser caching should be allowed

at line 73
static void setHeader(string $name, string $value, boolean $replace = false)

Set a header.

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

Parameters

string $name
string $value
boolean $replace

Return Value

void

at line 99
static array getHeaders()

Return array of headers.

Return Value

array

at line 110
static void clearHeaders()

Clear headers.

Return Value

void

at line 121
static void sendHeaders()

Send all headers.

Return Value

void

at line 147
static void setBody(string $content)

Set body content.

If body content already defined, this will replace it.

Parameters

string $content

Return Value

void

at line 160
static void prependBody(string $content)

Prepend content to the body content

Parameters

string $content

Return Value

void

at line 173
static void appendBody(string $content)

Append content to the body content

Parameters

string $content

Return Value

void

at line 186
static string getBody(boolean $toArray = false)

Return the body content

Parameters

boolean $toArray Whether or not to return the body content as an array of strings or as a single string; defaults to false.

Return Value

string array

at line 209
static string toString(boolean $compress = false)

Sends all headers prior to returning the string

Parameters

boolean $compress If true, compress the data

Return Value

string