SiteApplication
class SiteApplication extends CMSApplication
Joomla! Site Application class
Properties
string | $charSet | from WebApplication | |
string | $mimeType | from WebApplication | |
JDate | $modifiedDate | from WebApplication | |
JApplicationWebClient | $client | from WebApplication | |
string | $scope | The scope of the application. | from CMSApplication |
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 CMSApplication object, only creating it if it doesn't already exist.
Initialise the application.
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.
Set body content. If body content already defined, this will replace it.
Prepend content to the body content
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.
Enqueue a system message.
Gets a configuration value.
Return a reference to the \JMenu object.
Return a reference to the \JPathway object.
Return a reference to the \JRouter object.
Gets the name of the current template.
Gets the value of a user state variable.
Checks if HTTPS is forced in the client configuration.
Login authentication function
Logout authentication function.
Sets the value of a user state variable.
Sends all headers prior to returning the string
Dispatch the application
Return the current state of the detect browser option.
Return the current state of the language filter.
Get the application parameters
Get the application parameters
Set the current state of the detect browser option.
Set the current state of the language filter.
Overrides the default template that would be used
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 CMSApplication object, only creating it if it doesn't already exist.
This method must be invoked as: $web = CMSApplication::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.
void
afterSessionStart()
After the session has been started we need to populate it with some default values.
void
checkSession()
Checks the user session.
If the session record doesn't exist, initialise it. If session is new, create session variables
JMenu|null
getMenu(
string $name = 'site',
array $options = array())
Return a reference to the \JMenu object.
JPathway|null
getPathway(
string $name = 'site',
array $options = array())
Return a reference to the \JPathway object.
static
JRouter|null
getRouter(
string $name = 'site',
array $options = array())
Return a reference to the \JRouter object.
mixed
getUserStateFromRequest(
string $key,
string $request,
string $default = null,
string $type = 'none')
Gets the value of a user state variable.
boolean
isHttpsForced(
integer $clientId = null)
Checks if HTTPS is forced in the client configuration.
boolean|JException
login(
array $credentials,
array $options = array())
Login authentication function
boolean
logout(
integer $userid = null,
array $options = array())
Logout authentication function.
Passed the current user information to the onUserLogout event and reverts the current session record back to 'anonymous' parameters. If any of the authentication plugins did not successfully complete the logout routine then the whole method fails. Any errors raised should be done in the plugin as this provides the ability to give much more information about why the routine may have failed.