summaryrefslogtreecommitdiff
path: root/doc/en_US/plugin-events.markdown
blob: f4db8ff3a6a56df4bf7447f0186c0c77fb9aebab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Using Events
============

Kanboard use internally the [Symfony EventDispatcher component](https://symfony.com/doc/2.3/components/event_dispatcher/index.html) to manage internal events.

Event Listening
---------------

```php
$this->on('app.bootstrap', function($container) {
    // Do something
});
```

- The first argument is the event name (string)
- The second argument is a PHP callable function (closure or class method)

Adding a new event
------------------

To add a new event, you have to call the method `register()` of the class `Kanboard\Core\Event\EventManager`:

```php
$this->eventManager->register('my.event.name', 'My new event description');
```

These events can be used by other components of Kanboard like automatic actions.