JApplicationBase

Extends \Joomla\Application\AbstractApplication

Joomla Platform Base Application Class

abstract
property-read

The application input object

since

12.1

package

Joomla.Platform

Methods

__construct

Class constructor.

__construct(\Joomla\Input\Input $input = null, \Joomla\Registry\Registry $config = null) 
inherited
since

1.0

Arguments

$input

\Joomla\Input\InputAn optional argument to provide dependency injection for the application's input object. If the argument is an Input object that object will become the application's input object, otherwise a default input object is created.

$config

\Joomla\Registry\RegistryAn optional argument to provide dependency injection for the application's config object. If the argument is a Registry object that object will become the application's config object, otherwise a default config object is created.

close

Method to close the application.

close(integer $code) : void
inherited
since

1.0

Arguments

$code

integerThe exit code (optional; default is 0).

doExecute

Method to run the application routines. Most likely you will want to instantiate a controller and execute it, or perform some sort of task directly.

doExecute() : void
inherited abstract
since

1.0

execute

Execute the application.

execute() : void
inherited
since

1.0

get

Returns a property of the object or the default value if the property is not set.

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

1.0

Arguments

$key

stringThe name of the property.

$default

mixedThe default value (optional) if none is set.

Response

mixedThe value of the configuration.

getIdentity

Get the application identity.

getIdentity() : mixed
since

12.1

Response

mixedA JUser object or null.

getLogger

Get the logger.

getLogger() : \Psr\Log\LoggerInterface
inherited
since

1.0

Response

\Psr\Log\LoggerInterface

initialise

Custom initialisation method.

initialise() : void
inherited

Called at the end of the AbstractApplication::__construct method. This is for developers to inject initialisation code for their application classes.

since

1.0

loadDispatcher

Allows the application to load a custom or default dispatcher.

loadDispatcher(\JEventDispatcher $dispatcher = null) : \JApplicationBase

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.

since

12.1

Arguments

$dispatcher

\JEventDispatcherAn optional dispatcher object. If omitted, the factory dispatcher is created.

Response

\JApplicationBaseThis method is chainable.

loadIdentity

Allows the application to load a custom or default identity.

loadIdentity(\JUser $identity = null) : \JApplicationBase

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.

since

12.1

Arguments

$identity

\JUserAn optional identity object. If omitted, the factory user is created.

Response

\JApplicationBaseThis method is chainable.

registerEvent

Registers a handler to a particular event group.

registerEvent(string $event, callable $handler) : \JApplicationBase
since

12.1

Arguments

$event

stringThe event name.

$handler

callableThe handler, a function or an instance of an event object.

Response

\JApplicationBaseThe application to allow chaining.

set

Modifies a property of the object, creating it if it does not already exist.

set(string $key, mixed $value = null) : mixed
inherited
since

1.0

Arguments

$key

stringThe name of the property.

$value

mixedThe value of the property to set (optional).

Response

mixedPrevious value of the property

setConfiguration

Sets the configuration for the application.

setConfiguration(\Joomla\Registry\Registry $config) : \Joomla\Application\AbstractApplication
inherited
since

1.0

Arguments

$config

\Joomla\Registry\RegistryA registry object holding the configuration.

Response

\Joomla\Application\AbstractApplicationReturns itself to support chaining.

setLogger

Set the logger.

setLogger(\Psr\Log\LoggerInterface $logger) : \Joomla\Application\AbstractApplication
inherited
since

1.0

Arguments

$logger

\Psr\Log\LoggerInterfaceThe logger.

Response

\Joomla\Application\AbstractApplicationReturns itself to support chaining.

triggerEvent

Calls all handlers associated with an event group.

triggerEvent(string $event, array $args = null) : array
since

12.1

Arguments

$event

stringThe event name.

$args

arrayAn array of arguments (optional).

Response

arrayAn array of results from each function call, or null if no dispatcher is defined.

Properties

dispatcher

The application dispatcher object.

identity

The application identity object.

Type(s)

\JUser

config

The application configuration object.

inherited

input

The application input object.

inherited

logger

A logger.

inherited

Type(s)

\Psr\Log\LoggerInterface

input

The application input object.

The application input object

Type(s)

\JInput