Plugins
in
Plugins interface that any plugin file must be implemented to work.
Tags
Table of Contents
Methods
- __construct() : mixed
- Class constructor.
- disable() : mixed
- When plugin is disabled, this method will be called.
- enable() : mixed
- When plugin is enabled, this method will be called.
- registerHooks() : mixed
- Register action and/or filter hooks.
- uninstall() : mixed
- Your uninstall action on uninstall or delete a plugin.
Methods
__construct()
Class constructor.
public
__construct(Container $Container) : mixed
Set the container to protected property for easy access from the other part in the plugin class.
Example:
$this->Container = $Container;
Parameters
- $Container : Container
-
The DI container class.
disable()
When plugin is disabled, this method will be called.
public
disable() : mixed
Do not echo out in this method or it will not functional.
enable()
When plugin is enabled, this method will be called.
public
enable() : mixed
Do not echo out in this method or it will not functional.
registerHooks()
Register action and/or filter hooks.
public
registerHooks() : mixed
Example:
$Plugins = $this->Container->get('Plugins'); $YourClass = new \Rdb\Modules\YourModule\Plugins\YourPlugin\YourPluginClass(); $Plugins->addHook('hook.name', [$YourClass, 'yourActionHook'], 10);
uninstall()
Your uninstall action on uninstall or delete a plugin.
public
uninstall() : mixed
Do not echo out in this method or it will not functional.