class Plugin (View source)

Properties

protected string $key

The plugin key.

protected string $name

The plugin name.

protected string $description

The plugin description.

protected AssetGroup $requiredAssetGroup

The list of required assets for this plugin.

Methods

__construct()

Initialize the instance.

getRequiredAssets()

Get the list of required assets for this plugin.

requireAsset(AssetInterface|string $assetType, string|null|false $assetHandle = false)

Add an asset to the assets required for this plugin.

string
getKey()

Get the plugin key.

setKey(string $key)

Set the plugin key.

string
getName()

Get the plugin name.

setName(string $name)

Set the plugin name.

string
getDescription()

Get the plugin description.

setDescription(string $description)

Set the plugin description.

Details

__construct()

Initialize the instance.

AssetGroup getRequiredAssets()

Get the list of required assets for this plugin.

Return Value

AssetGroup

requireAsset(AssetInterface|string $assetType, string|null|false $assetHandle = false)

Add an asset to the assets required for this plugin.

Parameters

AssetInterface|string $assetType

The asset to require, or the asset group handle, or the asset type (in this case, specify the $assetHandle parameter)

string|null|false $assetHandle

the handle of the asset to specify (if $assetType is the asset type handle)

Exceptions

Exception

throws an Exception if the asset is not valid

string getKey()

Get the plugin key.

Return Value

string

setKey(string $key)

Set the plugin key.

Parameters

string $key

string getName()

Get the plugin name.

Return Value

string

setName(string $name)

Set the plugin name.

Parameters

string $name

string getDescription()

Get the plugin description.

Return Value

string

setDescription(string $description)

Set the plugin description.

Parameters

string $description