ajaxian
(Dorioajax)
December 7, 2010, 9:06am
1
Hi,
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 ?
zaccaria
(Matteo Falsitta)
December 7, 2010, 10:18am
2
Take a look at the doc of CClientScript.
You can access this object with:
Yii::app()->clientScript()->registerCoreScript('jQuery');
For example.
ajaxian
(Dorioajax)
December 7, 2010, 10:29am
3
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 …)
zaccaria
(Matteo Falsitta)
December 7, 2010, 10:32am
4
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.
ajaxian
(Dorioajax)
December 7, 2010, 10:39am
5
Thanks Zaccaria…
I will do the same, then.
ajaxian:
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 …)
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');
demo235
(Demo235)
September 12, 2011, 12:18pm
9
I have the same problem.Thanks.
hooky_2005
(Hooky 2005)
November 22, 2012, 2:59am
10
i have the same problem too, thank you very mach