How to enable JQueryUI everywhere?

Hi guys,

is there a way to enable JQuery UI library everywhere in a Yii application? I’d like a way to enable all my javascript in the main.php config file with all my css. I’m trying to use scriptMap but when I use a Yii widget that uses JqueryUI too it seems that Yii include the same JS library another time and this generates error…

someone can help me please?



You have to use this code in layout file(or eventually in your view file, depending on situation).

Thanks Ivica, but if I want to set this in the config main.php file is possible or not? As I’ve have just done for jquery.js and jquery.min.js using the scriptmap array of clientscript component:

scriptmap => array(

‘jquery.js’ => true,

‘jquery.min.js’ => false,


I think you should be able to do something like this in config file:






And then you will reference to it as ui.js for example.

I have added this script in config/main.php component. But it don’t works



                'jquery.js' => true,

                'jquery.min.js' => false,



Not sure it’s a good idea but I added this in the base controller.

class Controller extends CController



        public function beforeAction($action)








		return parent::beforeAction($action);



Works but perhaps not conventional.