What are Aikeedo Plugins?
Aikeedo plugins are Composer packages that extend the functionality of your platform. They allow you to:- Add new features
- Integrate with third-party services
- Customize existing functionality
Plugins give you the flexibility to tailor Aikeedo to your specific requirements without modifying the core codebase.
Prerequisites
Before you begin, make sure you have:- Basic knowledge of PHP and Composer
- A local development environment set up for Aikeedo
- Composer installed on your system
Step-by-Step Plugin Creation
Let’s create a plugin that integrates CurrencyBeacon as an alternative currency rate provider for your Aikeedo platform.Step 1: Create the Plugin Directory
First, create a new directory for your plugin in the/public/content/plugins
folder of your Aikeedo installation:
The directory structure should follow the format:
yourorganization/plugin-name
. This naming convention helps identify and organize plugins.Step 2: Create the composer.json File
Every Aikeedo plugin requires acomposer.json
file. This file contains essential metadata about your plugin.
Create a composer.json
file in your plugin directory with the following content:
name
: Must match the path to your plugin directory (yourorganization/plugin-name
)type
: Always set toaikeedo-plugin
for Aikeedo pluginsversion
: Defines the current version of your pluginrequire
: Lists the dependencies, including the requiredheyaikeedo/composer
packageextra.entry-class
: Specifies the main class of your pluginautoload
: Sets up PSR-4 autoloading for your plugin’s classes
The
heyaikeedo/composer
package is required for all Aikeedo plugins. It provides essential functionality for plugin integration.Step 3: Create the Plugin Class
Now, let’s create the main plugin class. This class will be responsible for initializing your plugin’s functionality. Create a file namedPlugin.php
in the src
directory of your plugin:
PluginInterface
, which requires a boot
method. The boot
method is called when your plugin is loaded by Aikeedo, allowing you to set up any necessary functionality.
Step 4: Install the Plugin
With your plugin structure in place, you can now install it using Composer. Run the following command in the root directory of your Aikeedo installation:Step 5: Enable the Plugin
After installation, you’ll need to enable your plugin through the Aikeedo dashboard. Look for the “Plugins” section in your admin panel to activate your new plugin.Best Practices and Tips
- Version Control: Use Git or another version control system to track changes to your plugin.
- Updates: Regularly update your plugin to maintain compatibility with the latest Aikeedo version.
Example Implementation
For a complete, working example of an Aikeedo plugin, check out the Currency Beacon Plugin Repository on GitHub.Need Help?
If you encounter any issues or have questions about plugin development, don’t hesitate to reach out:- Email our support team at support@aikeedo.com
- Check out our API Overview for more advanced integrations