DummyPlugin

Extends \Joomla\CMS\Plugin\CMSPlugin

Placeholder plugin.

since

4.0.0

Methods

__construct

Constructor

__construct( &$subject, array $config = array()) 
inherited
since

1.5

Arguments

$subject

$config

arrayAn optional associative array of configuration settings. Recognized key values include 'name', 'group', 'params', 'language' (this list is not meant to be comprehensive).

loadLanguage

Loads the plugin language file

loadLanguage(string $extension = '', string $basePath = JPATH_ADMINISTRATOR) : boolean
inherited
since

1.5

Arguments

$extension

stringThe extension for which a language file should be loaded

$basePath

stringThe basepath to use

Response

booleanTrue, if the file has successfully loaded.

parameterImplementsEventInterface

Checks if parameter is typehinted to accept \Joomla\Event\EventInterface.

parameterImplementsEventInterface(\ReflectionParameter $parameter) : boolean
inherited
since

4.0.0

Arguments

$parameter

\ReflectionParameter

Response

boolean

registerLegacyListener

Registers a legacy event listener, i.e. a method which accepts individual arguments instead of an AbstractEvent in its arguments. This provides backwards compatibility to Joomla! 3.x-style plugins.

registerLegacyListener(string $methodName) : void
inherited final

This method will register lambda functions (closures) which try to unwrap the arguments of the dispatched Event into old style method arguments and call your on method with them. The result will be passed back to the Event, as an element into an array argument called 'result'.

since

4.0.0

Arguments

$methodName

stringThe method name to register

registerListener

Registers a proper event listener, i.e. a method which accepts an AbstractEvent as its sole argument. This is the preferred way to implement plugins in Joomla! 4.x and will be the only possible method with Joomla! 5.x onwards.

registerListener(string $methodName) : void
inherited final
since

4.0.0

Arguments

$methodName

stringThe method name to register

registerListeners

Registers legacy Listeners to the Dispatcher, emulating how plugins worked under Joomla! 3.x and below.

registerListeners() : void
inherited

By default, this method will look for all public methods whose name starts with "on". It will register lambda functions (closures) which try to unwrap the arguments of the dispatched Event into method call arguments and call your on method. The result will be passed back to the Event into its 'result' argument.

This method additionally supports Joomla\Event\SubscriberInterface and plugins implementing this will be registered to the dispatcher as a subscriber.

since

4.0.0

Properties

params

A Registry object holding the parameters for the plugin

inherited
since

1.5

Type(s)

\Joomla\Registry\Registry

_name

The name of the plugin

inherited
since

1.5

Type(s)

string

_type

The plugin type

inherited
since

1.5

Type(s)

string

autoloadLanguage

Affects constructor behavior. If true, language files will be loaded automatically.

inherited
since

3.1

Type(s)

boolean

allowLegacyListeners

Should I try to detect and register legacy event listeners, i.e. methods which accept unwrapped arguments? While this maintains a great degree of backwards compatibility to Joomla! 3.x-style plugins it is much slower. You are advised to implement your plugins using proper Listeners, methods accepting an AbstractEvent as their sole parameter, for best performance. Also bear in mind that Joomla! 5.x onwards will only allow proper listeners, removing support for legacy Listeners.

inherited deprecated
since

4.0.0

deprecated

Type(s)

boolean