Loading jQuery ui Css file


I can easily load js files and my own css files.

But I’m unable to load th ejquery-ui.css which is intended to be encompassed in the Yii framework.

I can put the jQuery-ui css file from jquery to my own private Css directory but I would prefer reusing the one included in Yii.

And for sure I prefer clientScript registerCssFile method rather than other method…

My question is How can I do this ?

Take a look at the doc of CClientScript.

You can access this object with:


For example.

Thanks Zaccaria,

My question was relative to Css rather than for js. For js there is no problem

I use the code you mention and it works perfect.

It is for Css that I have a problem (for including a Css that is embedded in Yii, I mean the jquery-ui.css, somewhere in the framework …)

That is a problem for me too.

I usually include my own class, even because I don’t like any of the default style of jui, so I have mine one.

Thanks Zaccaria…

I will do the same, then.

Once published, you could reference the css like this:

// previously i have register the jquery-ui!!! ->registerCoreScript('jquery.ui.js');

// cs is CClientScript (Yii::app()->getClientScript()<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/wink.gif' class='bbc_emoticon' alt=';)' />

$cssCoreUrl = $cs->getCoreScriptUrl();

// now that we know the core folder, register 

$cs->registerCssFile($cssCoreUrl . '/jui/css/base/jquery-ui.css'); 

Works like a charm.

Thanks Antonio


I have the same problem.Thanks.

i have the same problem too, thank you very mach