How to use CClientScript


(Dwroy01) #1

Who can give me a simple example how to use cclientScript to append js script on head


(Agitated) #2

In some class/action:




$jsFile = 'somescript.js';


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

$cs->registerScriptFile($jsFile, CClientScript::POS_HEAD);




(Dwroy01) #3

thank you