Actually I want to define a json variable in my controller and access it in my js file.
I used to do it in yii framework like below:
Yii::app()->clientScript->registerScript('helpers', '
yii= {
test: 'test'
};
',CClientScript::POS_HEAD);
And I can access it like yii.test in js file.
For some reason I don't want to declare it directly in view header or footer part.
Thanks in advance