I’m inserting JS like this:
Yii::app()->clientScript->registerScript('test',"alert('test')",CClientScript::POS_READY);
But how can I assign an HTML ID attribute to it? (<script id=‘myVal’ …></script>)
I would expect something like this, but it’s obviously not working:
Yii::app()->clientScript->registerScript('test',"alert('test')",
CClientScript::POS_READY,array("id"=>"myVal");
I’ve searched the API but I couldn’t find anything. What would be the proper way of extending/modifying the clientscript behaviour to make this possible? Has anyone done this before?