CMSWebApplicationInterface

Extends \Joomla\Application\SessionAwareWebApplicationInterface, \Joomla\CMS\Application\CMSApplicationInterface

Interface defining a Joomla! CMS Application class for web applications.

since

4.0.0

Methods

bootComponent

Boots the component with the given name.

bootComponent(string $component) : \Joomla\CMS\Extension\ComponentInterface
inherited
since

4.0.0

Arguments

$component

stringThe component to boot.

Response

\Joomla\CMS\Extension\ComponentInterface

bootModule

Boots the module with the given name.

bootModule(string $module, string $applicationName) : \Joomla\CMS\Extension\ModuleInterface
inherited
since

4.0.0

Arguments

$module

stringThe module to boot

$applicationName

stringThe application name

Response

\Joomla\CMS\Extension\ModuleInterface

bootPlugin

Boots the plugin with the given name and type.

bootPlugin(string $plugin, string $type) : \Joomla\CMS\Extension\PluginInterface
inherited
since

4.0.0

Arguments

$plugin

stringThe plugin name

$type

stringThe type of the plugin

Response

\Joomla\CMS\Extension\PluginInterface

enqueueMessage

Enqueue a system message.

enqueueMessage(string $msg, string $type = self::MSG_INFO) : void
inherited
since

4.0.0

Arguments

$msg

stringThe message to enqueue.

$type

stringThe message type.

getDispatcher

Get the event dispatcher.

getDispatcher() : \Joomla\Event\DispatcherInterface
inherited
since

4.0.0

throws

\UnexpectedValueExceptionMay be thrown if the dispatcher has not been set.

Response

\Joomla\Event\DispatcherInterface

getDocument

Method to get the application document object.

getDocument() : \Joomla\CMS\Document\Document
since

4.0.0

Response

\Joomla\CMS\Document\DocumentThe document object

getIdentity

Get the application identity.

getIdentity() : \Joomla\CMS\User\User|null
inherited
since

4.0.0

Response

\Joomla\CMS\User\User|nullA User object or null if not set.

getInput

Method to get the application input object.

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

4.0.0

Response

\Joomla\Input\Input

getLanguage

Method to get the application language object.

getLanguage() : \Joomla\CMS\Language\Language
inherited
since

4.0.0

Response

\Joomla\CMS\Language\LanguageThe language object

getMenu

Get the menu object.

getMenu(string $name = null, array $options = array()) : \Joomla\CMS\Menu\AbstractMenu|null
since

4.0.0

Arguments

$name

stringThe application name for the menu

$options

arrayAn array of options to initialise the menu with

Response

\Joomla\CMS\Menu\AbstractMenu|nullAn AbstractMenu object or null if not set.

getMessageQueue

Get the system message queue.

getMessageQueue() : array
inherited
since

4.0.0

Response

arrayThe system message queue.

getName

Gets the name of the current running application.

getName() : string
inherited
since

4.0.0

Response

stringThe name of the application.

getRouter

Returns the application Router object.

getRouter(string $name = null, array $options = array()) : \Joomla\CMS\Router\Router
static
since

4.0.0

Arguments

$name

stringThe name of the application.

$options

arrayAn optional associative array of configuration settings.

Response

\Joomla\CMS\Router\Router

getUserState

Gets a user state.

getUserState(string $key, mixed $default = null) : mixed
since

4.0.0

Arguments

$key

stringThe path of the state.

$default

mixedOptional default value, returned if the internal value is null.

Response

mixedThe user state or null.

getUserStateFromRequest

Gets the value of a user state variable.

getUserStateFromRequest(string $key, string $request, string $default = null, string $type = 'none') : mixed
since

4.0.0

Arguments

$key

stringThe key of the user state variable.

$request

stringThe name of the variable passed in a request.

$default

stringThe default value for the variable if not found. Optional.

$type

stringFilter for the variable, for valid values see {@link InputFilter::clean()}. Optional.

Response

mixedThe request user state.

isCli

Flag if the application instance is a CLI or web based application.

isCli() : boolean
inherited deprecated

Helper function, you should use the native PHP functions to detect if it is a CLI application.

since

4.0.0

deprecated

5.0 Will be removed without replacements

Response

boolean

isClient

Check the client interface by name.

isClient(string $identifier) : boolean
inherited
since

4.0.0

Arguments

$identifier

stringString identifier for the application interface

Response

booleanTrue if this application is of the given type client interface.

loadIdentity

Allows the application to load a custom or default identity.

loadIdentity(\Joomla\CMS\User\User $identity = null) : $this
inherited
since

4.0.0

Arguments

$identity

\Joomla\CMS\User\UserAn optional identity object. If omitted, the factory user is created.

Response

$this

setUserState

Sets the value of a user state variable.

setUserState(string $key, mixed $value) : mixed|void
since

4.0.0

Arguments

$key

stringThe path of the state.

$value

mixedThe value of the variable.

Response

mixed|voidThe previous state, if one existed. Void otherwise.

triggerEvent

Calls all handlers associated with an event group.

triggerEvent(string $eventName, array|\Joomla\Event\Event $args = array()) : array
inherited deprecated

This is a legacy method, implementing old-style (Joomla! 3.x) plugin calls. It's best to go directly through the Dispatcher and handle the returned EventInterface object instead of going through this method. This method is deprecated and will be removed in Joomla! 5.x.

This method will only return the 'result' argument of the event

since

4.0.0

throws

\InvalidArgumentException

deprecated

5.0

Arguments

$eventName

stringThe event name.

$args

array|\Joomla\Event\EventAn array of arguments or an Event object (optional).

Response

arrayAn array of results from each function call. Note this will be an empty array if no dispatcher is set.

Constants

MSG_EMERGENCY

Constant defining an enqueued emergency message

inherited
Value 'emergency'
since

4.0.0

Type(s)

string

MSG_ALERT

Constant defining an enqueued alert message

inherited
Value 'alert'
since

4.0.0

Type(s)

string

MSG_CRITICAL

Constant defining an enqueued critical message

inherited
Value 'critical'
since

4.0.0

Type(s)

string

MSG_ERROR

Constant defining an enqueued error message

inherited
Value 'error'
since

4.0.0

Type(s)

string

MSG_WARNING

Constant defining an enqueued warning message

inherited
Value 'warning'
since

4.0.0

Type(s)

string

MSG_NOTICE

Constant defining an enqueued notice message

inherited
Value 'notice'
since

4.0.0

Type(s)

string

MSG_INFO

Constant defining an enqueued info message

inherited
Value 'info'
since

4.0.0

Type(s)

string

MSG_DEBUG

Constant defining an enqueued debug message

inherited
Value 'debug'
since

4.0.0

Type(s)

string