public function registerAssetBundle($name)
    {
        if (($bundle = $this->getAssetBundleFromView($name)) === false) {
            return $bundle;
        }

        $config = $this->getConfig();

        if (!($module = $config->getModule($name))) {
            $module = $config->addModule($name);
        }

        $options = $bundle->jsOptions;

        if (!isset($options['position'])) {
            $options['position'] = View::POS_END;
        }

        $options['baseUrl'] = $bundle->baseUrl;

        $module->setOptions($options);

        // TODO: think about optimization
        foreach ($bundle->depends as $dependency) {
            if (($dependency = $this->registerAssetBundle($dependency)) !== false) {
                $module->addDependency($dependency);
            }
        }

        $this->importJsFilesFromBundle($bundle, $module);

        return $module;
    }
public function registerAssetBundle($name)
    {
        if (($bundle = $this->getAssetBundleFromView($name)) === false) {
            return $bundle;
        }

        $config = $this->getConfig();

        if (!($module = $config->getModule($name))) {
            $module = $config->addModule($name);
        }

        $options = $bundle->jsOptions;

        if (!isset($options['position'])) {
            $options['position'] = View::POS_END;
        }

        $options['baseUrl'] = $bundle->baseUrl;

        $module->setOptions($options);

        // TODO: think about optimization
        foreach ($bundle->depends as $dependency) {
            if (($dependency = $this->registerAssetBundle($dependency)) !== false) {
                $module->addDependency($dependency);
            }
        }

        $this->importJsFilesFromBundle($bundle, $module);

        return $module;
    }
public function registerAssetBundle ( $ name ) { if ( ( $ bundle = $ this -> getAssetBundleFromView ( $ name ) ) === false ) { return $ bundle ; } $ config = $ this -> getConfig ( ) ; if ( ! ( $ module = $ config -> getModule ( $ name ) ) ) { $ module = $ config -> addModule ( $ name ) ; } $ options = $ bundle -> jsOptions ; if ( ! isset ( $ options [ 'position' ] ) ) { $ options [ 'position' ] = View :: POS_END ; } $ options [ 'baseUrl' ] = $ bundle -> baseUrl ; $ module -> setOptions ( $ options ) ; // TODO: think about optimization foreach ( $ bundle -> depends as $ dependency ) { if ( ( $ dependency = $ this -> registerAssetBundle ( $ dependency ) ) !== false ) { $ module -> addDependency ( $ dependency ) ; } } $ this -> importJsFilesFromBundle ( $ bundle , $ module ) ; return $ module ; }
Registers asset bundle in the loader

@param string $name

@return ModuleInterface|false an instance of registered module or false if asset bundle was not registered
Registers asset bundle in the loader