yii javascript script inline

cakephp, php, yii

Solution

$script = <<< EOD

/* here you write your javascript normally in multiple lines */

EOD;

Yii::app()->clientScript->registerScript('someId', $script);

You can write like this.

Problem

i have a very long javascript and i need to use YII CHtml function inside it, however, the quote string making the code very messy. for example, ``` $script = "$('#car_brand').click(function(e), { //codes var car_name = /"bmw/"; });"; <?php Yii::app()->clientScript->registerScript('car-js', $script); ?> ``` the above problem just showing an example of short version. Is there anything equailvent to CakePHP's scriptBlock function? http://book.cakephp.org/1.3/view/1604/scriptBlock Thanks

Original source