WebApplication
class WebApplication extends BaseApplication
Base class for a Joomla! Web application.
Properties
string | $charSet | ||
string | $mimeType | ||
JDate | $modifiedDate | ||
JApplicationWebClient | $client |
Methods
Class constructor.
Registers a handler to a particular event group.
Calls all handlers associated with an event group.
Allows the application to load a custom or default dispatcher.
Allows the application to load a custom or default identity.
Returns a reference to the global WebApplication object, only creating it if it doesn't already exist.
Initialise the application.
Execute the application.
Redirect to another URL.
Load an object or array into the application configuration object.
Set/get cachable state for the response. If $allow is set, sets the cachable state of the response. Always returns the current state.
Method to set a response header. 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.
Method to get the array of response headers to be sent when the response is sent to the client.
Method to clear any set response headers.
Send the response headers.
Set body content. If body content already defined, this will replace it.
Prepend content to the body content
Append content to the body content
Return the body content
Method to get the application document object.
Method to get the application language object.
Method to get the application session object.
Flush the media version to refresh versionable assets
Determine if we are using a secure (SSL) connection.
Allows the application to load a custom or default document.
Allows the application to load a custom or default language.
Allows the application to load a custom or default session.
After the session has been started we need to populate it with some default values.
Details
__construct(
Input $input = null,
Registry $config = null,
JApplicationWebClient $client = null)
Class constructor.
BaseApplication
registerEvent(
string $event,
callable $handler)
Registers a handler to a particular event group.
array
triggerEvent(
string $event,
array $args = null)
Calls all handlers associated with an event group.
BaseApplication
loadDispatcher(
JEventDispatcher $dispatcher = null)
Allows the application to load a custom or default dispatcher.
The logic and options for creating this object are adequately generic for default cases but for many applications it will make sense to override this method and create event dispatchers, if required, based on more specific needs.
BaseApplication
loadIdentity(
JUser $identity = null)
Allows the application to load a custom or default identity.
The logic and options for creating this object are adequately generic for default cases but for many applications it will make sense to override this method and create an identity, if required, based on more specific needs.
static
WebApplication
getInstance(
string $name = null)
Returns a reference to the global WebApplication object, only creating it if it doesn't already exist.
This method must be invoked as: $web = WebApplication::getInstance();
WebApplication
initialise(
mixed $session = null,
mixed $document = null,
mixed $language = null,
mixed $dispatcher = null)
Initialise the application.
void
redirect(
string $url,
integer $status = 303)
Redirect to another URL.
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.
WebApplication
loadConfiguration(
mixed $data)
Load an object or array into the application configuration object.
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 the current state.
WebApplication
setHeader(
string $name,
string $value,
boolean $replace = false)
Method to set a response header. 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.
array
getHeaders()
Method to get the array of response headers to be sent when the response is sent to the client.
WebApplication
setBody(
string $content)
Set body content. If body content already defined, this will replace it.
WebApplication
loadDocument(
JDocument $document = null)
Allows the application to load a custom or default document.
The logic and options for creating this object are adequately generic for default cases but for many applications it will make sense to override this method and create a document, if required, based on more specific needs.
WebApplication
loadLanguage(
JLanguage $language = null)
Allows the application to load a custom or default language.
The logic and options for creating this object are adequately generic for default cases but for many applications it will make sense to override this method and create a language, if required, based on more specific needs.
WebApplication
loadSession(
JSession $session = null)
Allows the application to load a custom or default session.
The logic and options for creating this object are adequately generic for default cases but for many applications it will make sense to override this method and create a session, if required, based on more specific needs.