php:
	//自定义数组参数
	$newarr = array('a1' => 'a1', 'a2' => 'a2', 'a3' => 'a3');
	$config = CScript::encode($newarr);
	Yii::app()->clientScript->registerScript('customConfig', "var customConfig = " . $config . ";", CClientScript::POS_HEAD);

	//yii 自带配置文件
	$yiiConfig = C::encode(Yii::app()->params->toArray());
	Yii::app()->clientScript->registerScript('appConfig',"var yiiConfig = " . $yiiConfig . ";", CClientScript::POS_HEAD);

	//分配变量
	Yii::app()->clientScript->registerScript('myparam', 'var abc = "Hello"', CClientScript::POS_HEAD);
	    
js:
	alert(customConfig.a1);
	alert(yiiConfig.alert.msg);
	alert(abc);


ps : 虽然yii 也有这种类似功能,但是个人感觉还是没有druopal中实现的好!