protected function registerExtensions(array $config)
    {
        foreach ($config as $entry) {

            // Parse config entry values
            $name = ArrayHelper::getValue($entry, 'name', false);
            $options = ArrayHelper::getValue($entry, 'options', '');
            $depends = ArrayHelper::getValue($entry, 'depends', []);

            // If extension is enabled
            if (in_array($name, $this->enabledExtensions)) {

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

                // Register extension
                $options = Json::encode($options);
                $this->view->registerJs(
                    "{$this->id}_ias.extension(new {$name}({$options}));",
                    View::POS_READY,
                    "{$this->id}_ias_{$name}"
                );
            }
        }
    }
protected function registerExtensions(array $config)
    {
        foreach ($config as $entry) {

            // Parse config entry values
            $name = ArrayHelper::getValue($entry, 'name', false);
            $options = ArrayHelper::getValue($entry, 'options', '');
            $depends = ArrayHelper::getValue($entry, 'depends', []);

            // If extension is enabled
            if (in_array($name, $this->enabledExtensions)) {

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

                // Register extension
                $options = Json::encode($options);
                $this->view->registerJs(
                    "{$this->id}_ias.extension(new {$name}({$options}));",
                    View::POS_READY,
                    "{$this->id}_ias_{$name}"
                );
            }
        }
    }
protected function registerExtensions ( array $ config ) { foreach ( $ config as $ entry ) { // Parse config entry values $ name = ArrayHelper :: getValue ( $ entry , 'name' , false ) ; $ options = ArrayHelper :: getValue ( $ entry , 'options' , '' ) ; $ depends = ArrayHelper :: getValue ( $ entry , 'depends' , [ ] ) ; // If extension is enabled if ( in_array ( $ name , $ this -> enabledExtensions ) ) { // Make sure dependencies are met if ( ! $ this -> checkEnabledExtensions ( $ depends ) ) { throw new InvalidConfigException ( "Extension {$name} requires " . implode ( ', ' , $ depends ) . " extensions to be enabled." ) ; } // Register extension $ options = Json :: encode ( $ options ) ; $ this -> view -> registerJs ( "{$this->id}_ias.extension(new {$name}({$options}));" , View :: POS_READY , "{$this->id}_ias_{$name}" ) ; } } }
Register jQuery IAS extensions.

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

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