protected function registerEventHandlers(array $config)
    {
        foreach ($config as $name => $depends) {

            // If event is enabled
            $eventName = 'eventOn' . ucfirst($name);
            if (!empty($this->$eventName)) {

                // Make sure dependencies are met
                if (!$this->checkEnabledExtensions($depends)) {
                    throw new InvalidConfigException(
                        "The \"{$name}\" event requires " . implode(', ', $depends) . " extensions to be enabled."
                    );
                }

                // Register event
                $this->view->registerJs(
                    "{$this->id}_ias.on('{$name}', {$this->$eventName});",
                    View::POS_READY,
                    "{$this->id}_ias_event_{$eventName}"
                );
            }
        }
    }
protected function registerEventHandlers(array $config)
    {
        foreach ($config as $name => $depends) {

            // If event is enabled
            $eventName = 'eventOn' . ucfirst($name);
            if (!empty($this->$eventName)) {

                // Make sure dependencies are met
                if (!$this->checkEnabledExtensions($depends)) {
                    throw new InvalidConfigException(
                        "The \"{$name}\" event requires " . implode(', ', $depends) . " extensions to be enabled."
                    );
                }

                // Register event
                $this->view->registerJs(
                    "{$this->id}_ias.on('{$name}', {$this->$eventName});",
                    View::POS_READY,
                    "{$this->id}_ias_event_{$eventName}"
                );
            }
        }
    }
protected function registerEventHandlers ( array $ config ) { foreach ( $ config as $ name => $ depends ) { // If event is enabled $ eventName = 'eventOn' . ucfirst ( $ name ) ; if ( ! empty ( $ this -> $ eventName ) ) { // Make sure dependencies are met if ( ! $ this -> checkEnabledExtensions ( $ depends ) ) { throw new InvalidConfigException ( "The \"{$name}\" event requires " . implode ( ', ' , $ depends ) . " extensions to be enabled." ) ; } // Register event $ this -> view -> registerJs ( "{$this->id}_ias.on('{$name}', {$this->$eventName});" , View :: POS_READY , "{$this->id}_ias_event_{$eventName}" ) ; } } }
Register jQuery IAS event handlers.

This method takes jQuery IAS event handlers definition as a parameter and registers this event handlers.

@param array $config jQuery IAS event handlers definition.
@throws \yii\base\InvalidConfigException If vent handlers dependencies are not met.
Register jQuery IAS event handlers .