how to include js file in controller
ie. some thing like this
public function actionIndex()
{
//load js file here
$this->render('index');
}
requirement is to load js file in a new page
how to include js file in controller
ie. some thing like this
public function actionIndex()
{
//load js file here
$this->render('index');
}
requirement is to load js file in a new page
got it
Yii::app()->clientScript->registerScriptFile(‘scripts/myfile.js’,CClientScript::POS_END);
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.