SessionAwareWebApplicationInterface

Extends WebApplicationInterface

Application sub-interface defining a web application class which supports sessions

since

2.0.0

package

Joomla Framework

Methods

allowCache

Set/get cachable state for the response.

allowCache( allow = null) : 
inherited

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

since

2.0.0

Arguments

allow

boolTrue to allow browser caching.

Response

bool

appendBody

Append content to the body content

appendBody( content) : 
inherited
since

2.0.0

Arguments

content

stringThe content to append to the response body.

Response

$this

checkToken

Checks for a form token in the request.

checkToken( method = 'post') : 
since

2.0.0

Arguments

method

stringThe request method in which to look for the token key.

Response

bool

clearHeaders

Method to clear any set response headers.

clearHeaders() : 
inherited
since

2.0.0

Response

$this

close

Method to close the application.

close( code) : 
inherited
since

2.0.0

Arguments

code

intThe exit code (optional; default is 0).

Response

void

execute

Execute the application.

execute() : 
inherited
since

2.0.0

Response

void

getBody

Return the body content

getBody() : 
inherited
since

2.0.0

Response

mixedThe response body as a string.

getFormToken

Method to determine a hash for anti-spoofing variable names

getFormToken( forceNew = false) : 
since

2.0.0

Arguments

forceNew

boolIf true, force a new token to be created

Response

stringHashed var name

getHeaders

Method to get the array of response headers to be sent when the response is sent to the client.

getHeaders() : mixed||string|int
inherited
since

2.0.0

Response

array<string|int, mixed>

getInput

Method to get the application input object.

getInput() : \Joomla\Input\Input
inherited
since

2.0.0

Response

Input

getResponse

Get the PSR-7 Response Object.

getResponse() : \Psr\Http\Message\ResponseInterface
inherited
since

2.0.0

Response

ResponseInterface

getSession

Method to get the application session object.

getSession() : \Joomla\Session\SessionInterface
since

2.0.0

Response

SessionInterfaceThe session object

isSslConnection

Determine if we are using a secure (SSL) connection.

isSslConnection() : 
inherited
since

2.0.0

Response

boolTrue if using SSL, false if not.

isValidHttpStatus

Check if the value is a valid HTTP status code

isValidHttpStatus( code) : 
inherited
since

2.0.0

Arguments

code

intThe potential status code

Response

bool

prependBody

Prepend content to the body content

prependBody( content) : 
inherited
since

2.0.0

Arguments

content

stringThe content to prepend to the response body.

Response

$this

redirect

Redirect to another URL.

redirect( url, int|bool status = 303) : 
inherited

If the headers have not been sent the redirect will be accomplished using a "301 Moved Permanently" or "303 See Other" code in the header pointing to the new location. If the headers have already been sent this will be accomplished using a JavaScript statement.

since

2.0.0

throws

InvalidArgumentException

Arguments

url

stringThe URL to redirect to. Can only be http/https URL

status

int|boolThe HTTP status code to be provided. 303 is assumed by default.

Response

void

sendHeaders

Send the response headers.

sendHeaders() : 
inherited
since

2.0.0

Response

$this

setBody

Set body content. If body content already defined, this will replace it.

setBody( content) : 
inherited
since

2.0.0

Arguments

content

stringThe content to set as the response body.

Response

$this

setHeader

Method to set a response header.

setHeader( name,  value,  replace = false) : 
inherited

If the replace flag is set then all headers with the given name will be replaced by the new one. The headers are stored in an internal array to be sent when the site is sent to the browser.

since

2.0.0

Arguments

name

stringThe name of the header to set.

value

stringThe value of the header to set.

replace

boolTrue to replace any headers with the same name.

Response

$this

setResponse

Set the PSR-7 Response Object.

setResponse(\Psr\Http\Message\ResponseInterface response) : 
inherited
since

2.0.0

Arguments

response

ResponseInterfaceThe response object

Response

void

setSession

Sets the session for the application to use, if required.

setSession(\Joomla\Session\SessionInterface session) : 
since

2.0.0

Arguments

session

SessionInterfaceA session object.

Response

$this