src/EventHandler.php
/**
     * attaches all events to all classNames
     * @param array $eventConfig commonly $this->events config
     */
attaches all events to all classNames
@param array $eventConfig commonly $this->events config
attaches all events to all classNames @param array $eventConfig commonly $this - > events config
public function attachEvents($eventConfig)
    {
        foreach ($eventConfig as $className => $events) {
            foreach ($events as $eventName => $handlers) {
                foreach ($handlers as $handler) {
                    if (is_array($handler) && is_callable($handler[0])) {
                        $data   = isset($handler[1]) ? array_pop($handler) : null;
                        $append = isset($handler[2]) ? array_pop($handler) : null;
                        Event::on($className, $eventName, $handler[0], $data, $append);
                    } else if (is_callable($handler)) {
                        Event::on($className, $eventName, $handler);
                    }
                }
            }
        }
    }
public function attachEvents ( $ eventConfig ) { foreach ( $ eventConfig as $ className => $ events ) { foreach ( $ events as $ eventName => $ handlers ) { foreach ( $ handlers as $ handler ) { if ( is_array ( $ handler ) && is_callable ( $ handler [ 0 ] ) ) { $ data = isset ( $ handler [ 1 ] ) ? array_pop ( $ handler ) : null ; $ append = isset ( $ handler [ 2 ] ) ? array_pop ( $ handler ) : null ; Event :: on ( $ className , $ eventName , $ handler [ 0 ] , $ data , $ append ) ; } else if ( is_callable ( $ handler ) ) { Event :: on ( $ className , $ eventName , $ handler ) ; } } } } }
attaches all events to all classNames
 @param array $eventConfig commonly $this->events config
attaches all events to all classNames @param array $eventConfig commonly $this - > events config