Yii Framework Forum: How to use CClientScript - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to use CClientScript Rate Topic: -----

#1 User is offline   Roy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 30-March 10

Posted 23 June 2010 - 10:30 PM

Who can give me a simple example how to use cclientScript to append js script on head
Man's grasp exceeds his imagination
0

#2 User is offline   drech 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 100
  • Joined: 06-April 09

Posted 23 June 2010 - 11:05 PM

In some class/action:

$jsFile = 'somescript.js';

$cs=Yii::app()->getClientScript();
$cs->registerScriptFile($jsFile, CClientScript::POS_HEAD);

0

#3 User is offline   Roy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 30-March 10

Posted 23 June 2010 - 11:50 PM

View Postdrech, on 23 June 2010 - 11:05 PM, said:

In some class/action:

$jsFile = 'somescript.js';

$cs=Yii::app()->getClientScript();
$cs->registerScriptFile($jsFile, CClientScript::POS_HEAD);


thank you
Man's grasp exceeds his imagination
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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