Hi, I’m currently using registerScriptFile and registerCssFile to register CSS and JS resources. I need 2 sets of them, one for general loading, and the other is page specific.
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile( Yii::app()->theme->baseUrl . '/bower_components/angular/angular.min.js' );
$cs->registerCssFile($base_url . '/bower_components/chosen/public/chosen.min.css');
The problem is, I think because the layout/main.php is loaded after the specific view is loaded, while using registerScriptFile
, the files registered in individual controller will be installed BEFORE the files registered in layout/main.php.
My current solution is to load the page specific scripts in CCLIENT::POS_END, and that’s fine for scripts. But it’s not fine for CSS Files. I have a bootstrap CSS loaded that I would like to override, and currently, because the bootstrap.min.css is loaded after the page specific CSS, it’s making the task difficult. I was wondering if there is another solution for this.