Custom event listenersΒΆ

If you wish to implement your own event listeners you are free to do so. The only requirement is that you implement the Imbo\EventListener\ListenerInterface interface that comes with Imbo. Below is the complete interface with comments:

 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
<?php
/**
 * This file is part of the Imbo package
 *
 * (c) Christer Edvartsen <cogo@starzinger.net>
 *
 * For the full copyright and license information, please view the LICENSE file that was
 * distributed with this source code.
 */

namespace Imbo\EventListener;

/**
 * Event listener interface
 *
 * @author Christer Edvartsen <cogo@starzinger.net>
 * @package Event\Listeners
 */
interface ListenerInterface {
    /**
     * Return a list of listener definitions
     *
     * @return ListenerDefinition[]
     */
    function getDefinition();
}

Have a look at the existing implementations of this interface for more details. If you implement a listener that you think should be a part of Imbo feel free to send a pull request to the project over at GitHub.