Plugins are "plug-and-play" applications that extend the functionality of Blesta. This section document explains how to design and develop plugins, and highlights the roles plugins may assume when rendering data.
- The Standalone Plugins section describes how to build plugins that add additional pages in Blesta.
- The Widgets section explains how to build mini applications using plugins.
- The Extending the API section explains how to use plugins to add additional functionality to the Blesta API.
- The ACL section describes how to integrate a plugin into Blesta's Access Control List.
- The Plugin Events section describes how to trigger a plugin to execute during special events.
- The Email section explains how to manage and send email through a plugin.
Getting Started with Plugins
Plugins follow the same MVC design pattern that Blesta adheres to. The plugin system in Blesta is provided as a feature of the minPHP . framework, Blesta simply defines the naming convention. For the purpose of this manual, the plugin name we'll refer to is my_plugin. Your plugin name will, of course, differ.
Info | ||
---|---|---|
| ||
A user will not be able to install two plugins with the same name, so try to use descriptive and non-generic terms for your plugin name. |
File Structure
Plugins are fully contained within their named plugin directory and placed in the /plugins/ directory. Below is the minimum required file structure for a plugin:
...
Finally, my_plugin_plugin.php is a special class that must extend the Plugin class of /components/plugins/lib/plugin.php. This class is used for installing, upgrading, uninstalling, and branding the plugin.