JResponse
class JResponse
JResponse Class.
This class serves to provide the Joomla Platform 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
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.
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.