src/Event/EventManager.php
public static function loadListeners()
    {
        $manager = self::instance();
        $plugins = Plugin::loaded();

        foreach ($plugins as $plugin) {
            $events = Plugin::getData($plugin, 'events')->getArrayCopy();
            foreach ($events as $name => $config) {
                if (is_numeric($name)) {
                    $name   = $config;
                    $config = [];
                }

                $class  = App::className($name, 'Event');
                $config = (array) $config;

                if ($class !== false) {
                    $listener = new $class($config);
                    $manager->on($listener, $config);
                }
            }
        }
    }
public static function loadListeners()
    {
        $manager = self::instance();
        $plugins = Plugin::loaded();

        foreach ($plugins as $plugin) {
            $events = Plugin::getData($plugin, 'events')->getArrayCopy();
            foreach ($events as $name => $config) {
                if (is_numeric($name)) {
                    $name   = $config;
                    $config = [];
                }

                $class  = App::className($name, 'Event');
                $config = (array) $config;

                if ($class !== false) {
                    $listener = new $class($config);
                    $manager->on($listener, $config);
                }
            }
        }
    }
public static function loadListeners ( ) { $ manager = self :: instance ( ) ; $ plugins = Plugin :: loaded ( ) ; foreach ( $ plugins as $ plugin ) { $ events = Plugin :: getData ( $ plugin , 'events' ) -> getArrayCopy ( ) ; foreach ( $ events as $ name => $ config ) { if ( is_numeric ( $ name ) ) { $ name = $ config ; $ config = [ ] ; } $ class = App :: className ( $ name , 'Event' ) ; $ config = ( array ) $ config ; if ( $ class !== false ) { $ listener = new $ class ( $ config ) ; $ manager -> on ( $ listener , $ config ) ; } } } }
Load Event Handlers during bootstrap.

Plugins can add their own custom EventHandler in Config/events.php
with the following format:

'events' => [
'Core.CoreEventHandler' => [
'options' = [
'callable' => '',
'priority' => '',
]
]
]

@return void
Load Event Handlers during bootstrap .