clientScript

Hi again,

I’m trying to write my own widget and I ran into someting strange … well. I found here http://www.yiiframew…xtension.create that, in order to publish CSS and JS (if needed), the CClientScript is my friend. Ok then, let’s call …

$cs=Yii::app()->getClientScript();

… like I’m suppose to. But then I an error is raised (call to undefined method CWebApplication::getClientScript()).

I looked into base classes, and it seems that none of the base classes (CWebApplication, CApplication, CComponent) contains the clientScript property. I found it in CController and writting …

 $cs=Yii::app()->getController()->getClientScript();

…I could publish and use my widget’s css (and believe me it’s sooo beautiful with colors  :D ).

Please, can anyone tell me if I’ve done something wrong ? is there some initialization that I missed  ? or is it really an error in the documentation ?

Thanks for your help

8)

There is a change about CClientScript since RC was released, and the guide online actually refers to the latest SVN code. So please update your code to use the latest SVN snapshot. This change is listed in the upgrade instruction when 1.0 will be formally released.

oh … next time I'll check the SVN

Thanks for your help

8)