Change Jqueryui Theme Globally

Hi,

I’m in desperate need of some help here. I am trying to change the jQuery UI theme to the ‘start’ theme site-wide.

I preferably do not want to have specify this in multiple views/controllers.

I have tried the following (inside Controller.php) which does not seem to have any affect:


        public function beforeRender($view) {

            Yii::app()->clientScript->registerCoreScript( 'jquery.ui' );

            $jui_start = Yii::app()->assetManager->publish( Yii::app()->basePath . '/vendor/jquery-ui/themes/start/' );

            Yii::app()->clientScript->registerCssFile( $jui_start . '/jquery.ui.css', 'screen' );

                    

            return true;

        } 

I have searched for a solution but I can’t find anything which works for me. Please help.

well this is possible depends what widgets you are using in any case all Jui widgets inherit/extend CJuiWidget if you configure that, that should do the trick

try this


<?php

// add this in main.php under components

... 

'widgetFactory'=>array(

	'widgets'=>array(

		'CJuiWidget'=>array(

		    'cssFile'=>'path.to.your.theme.css.file', // change this

		),

	),

),

...