For example this wiki article:
http://www.yiiframework.com/wiki/141/javascript-tabular-input/
Here it is the php view with a script inside.
There are some php code for render another view.
How can I publish this script using Assets Manager?
<script type="text/javascript">
// initializiation of counters for new elements
var lastStudent=<?php echo $students->lastNew?>;
// the subviews rendered with placeholders
var trStudent=new String(<?php echo CJSON::encode($this->renderPartial('form/studentRow', array('id'=>'idRep', 'model'=>new Student, 'form'=>$form), true));?>);
function addStudent(button)
{
lastStudent++;
button.parents('table').children('tbody').append(trStudent.replace(/idRep/g,'n'+lastStudent));
}
function deleteStudent(button)
{
button.parents('tr').detach();
}
</script>