Jump to content
Larry Ullman's Book Forums

Load External Js File From Controller


charles07
 Share

Recommended Posts

yup,

 

public function actionIndex()
{
           Yii::app()->clientScript->registerScriptFile('scripts/myfile.js',CClientScript::POS_END);
           $this->render('index');
}

i just wanted to load this file in a single page, if i load it in layouts/main.php page file would be loaded in entire site.

 

 

regards

charles

  • Upvote 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...