<?php Yii::app()->clientScript->registerScript("form",
<<<'JAVASCRIPT'
var a = 2;
<?PHP echo 'Something' ?>
JAVASCRIPT;
, CClientScript::POS_END); ?>
but its not working
I’m receiving this error
Parse error: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or heredoc end (T_END_HEREDOC) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN) in C:\xampp\htdocs\yii\project\protected\views\group\form.php on line 277
I think I can’t use those because they can’t handle an array. Anyway the problem is solve by using renderPartial and seperate the script into another php file. thanks for the help.