Yii Framework Forum: clientScript - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

clientScript Rate Topic: -----

#1 User is offline   Raoul 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 647
  • Joined: 29-November 08
  • Location:Paris, France

Posted 01 December 2008 - 11:52 AM

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)
0

#2 User is online   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,902
  • Joined: 04-October 08
  • Location:DC, USA

Posted 01 December 2008 - 12:01 PM

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.
0

#3 User is offline   Raoul 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 647
  • Joined: 29-November 08
  • Location:Paris, France

Posted 01 December 2008 - 12:07 PM

oh .... next time I'll check the SVN
Thanks for your help
8)

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users