diff options
Diffstat (limited to 'doc/plugin-registration.markdown')
-rw-r--r-- | doc/plugin-registration.markdown | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/doc/plugin-registration.markdown b/doc/plugin-registration.markdown index 746fa200..37e71f9a 100644 --- a/doc/plugin-registration.markdown +++ b/doc/plugin-registration.markdown @@ -138,40 +138,3 @@ $this->on('app.bootstrap', function($container) { - The first argument is the event name - The second argument is a PHP callable function (closure or class method) - -Extend Automatic Actions ------------------------- - -To define a new automatic action with a plugin, you just need to call the method `extendActions()` from the class `Kanboard\Model\Action`, here an example: - -```php -<?php - -namespace Kanboard\Plugin\AutomaticAction; - -use Kanboard\Core\Plugin\Base; - -class Plugin extends Base -{ - public function initialize() - { - $this->action->extendActions( - '\Kanboard\Plugin\AutomaticAction\Action\DoSomething', // Use absolute namespace - t('Do something when the task color change') - ); - } -} -``` - -- The first argument of the method `extendActions()` is the action class with the complete namespace path. **The namespace path must starts with a backslash** otherwise Kanboard will not be able to load your class. -- The second argument is the description of your automatic action. - -The automatic action class must inherit from the class `Kanboard\Action\Base` and implements all abstract methods: - -- `getCompatibleEvents()` -- `getActionRequiredParameters()` -- `getEventRequiredParameters()` -- `doAction(array $data)` -- `hasRequiredCondition(array $data)` - -For more details you should take a look to existing automatic actions or this [plugin example](https://github.com/kanboard/plugin-example-automatic-action). |