PluginHelper

Plugin helper class

abstract
since

1.5

Methods

getLayoutPath

Get the path to a layout from a Plugin

getLayoutPath(string $type, string $name, string $layout = 'default') : string
static
since

3.0

Arguments

$type

stringPlugin type

$name

stringPlugin name

$layout

stringLayout name

Response

stringLayout path

getPlugin

Get the plugin data of a specific type if no specific plugin is specified otherwise only the specific plugin data is returned.

getPlugin(string $type, string $plugin = null) : mixed
static
since

1.5

Arguments

$type

stringThe plugin type, relates to the subdirectory in the plugins directory.

$plugin

stringThe plugin name.

Response

mixedAn array of plugin data objects, or a plugin data object.

import

Loads the plugin file.

import(object $plugin, boolean $autocreate = true, \Joomla\Event\DispatcherInterface $dispatcher = null) : void
static
since

3.2

Arguments

$plugin

objectThe plugin.

$autocreate

booleanTrue to autocreate.

$dispatcher

\Joomla\Event\DispatcherInterfaceOptionally allows the plugin to use a different dispatcher.

importPlugin

Loads all the plugin files for a particular type if no specific plugin is specified otherwise only the specific plugin is loaded.

importPlugin(string $type, string $plugin = null, boolean $autocreate = true, \Joomla\Event\DispatcherInterface $dispatcher = null) : boolean
static
since

1.5

Arguments

$type

stringThe plugin type, relates to the subdirectory in the plugins directory.

$plugin

stringThe plugin name.

$autocreate

booleanAutocreate the plugin.

$dispatcher

\Joomla\Event\DispatcherInterfaceOptionally allows the plugin to use a different dispatcher.

Response

booleanTrue on success.

isEnabled

Checks if a plugin is enabled.

isEnabled(string $type, string $plugin = null) : boolean
static
since

1.5

Arguments

$type

stringThe plugin type, relates to the subdirectory in the plugins directory.

$plugin

stringThe plugin name.

Response

boolean

load

Loads the published plugins.

load() : array
static
since

3.2

Response

arrayAn array of published plugins

Properties

plugins

A persistent cache of the loaded plugins.

static
since

1.7

Type(s)

array