src/Controller/Component/CrudComponent.php
public function on($events, $callback, $options = [])
    {
        foreach ((array)$events as $event) {
            if (!strpos($event, '.')) {
                $event = $this->_config['eventPrefix'] . '.' . $event;
            }

            $this->_eventManager->on($event, $options, $callback);
        }
    }
public function on($events, $callback, $options = [])
    {
        foreach ((array)$events as $event) {
            if (!strpos($event, '.')) {
                $event = $this->_config['eventPrefix'] . '.' . $event;
            }

            $this->_eventManager->on($event, $options, $callback);
        }
    }
public function on ( $ events , $ callback , $ options = [ ] ) { foreach ( ( array ) $ events as $ event ) { if ( ! strpos ( $ event , '.' ) ) { $ event = $ this -> _config [ 'eventPrefix' ] . '.' . $ event ; } $ this -> _eventManager -> on ( $ event , $ options , $ callback ) ; } }
Attaches an event listener function to the controller for Crud Events.

@param string|array $events Name of the Crud Event you want to attach to controller.
@param callable $callback Callable method or closure to be executed on event.
@param array $options Used to set the `priority` and `passParams` flags to the listener.
@return void
Attaches an event listener function to the controller for Crud Events .