Creating a Plugin
Step 1: Create the Plugin Directory
public/plugin/MyPlugin/Step 2: Define the Plugin Class
<?php
class MyPluginPlugin extends Plugin
{
protected function __construct()
{
$settings = [
'tool_enable' => 'boolean',
'api_key' => 'text',
];
parent::__construct('1.0', 'Your Name', $settings);
}
public static function create(): static
{
static $instance = null;
return $instance ??= new static();
}
}Available Setting Types
Type
Description
Step 3: Create plugin.php
Step 4: Create Install and Uninstall Scripts
Step 5: Add Translations
Step 6: Inject Content via Display Regions
Step 7: React to Platform Events (Optional)
Step 8: Lifecycle Hooks
Method
Triggered when
Step 9: Activate
Tips
Last updated
Was this helpful?