Multiple Instances Of Model Within A Form

Hi all my problem is this need to handle multiple instances of a model in the same form with these fields eg




<div class="row" id="entrada" style="float:left; width:50%;">

        <?php echo $form->labelEx($modelCasoPrueba,'nombre_archivo_entrada',array('label'=>'Archivo de entrada')); ?>

        <?php echo $form->fileField($modelCasoPrueba,'nombre_archivo_entrada',array('size'=>60,'maxlength'=>256,"class"=>"lolcat","title"=>"Debe indicar la ubicacion del archivo de entrada")); ?>

        <?php echo $form->error($modelCasoPrueba,'nombre_archivo_entrada'); ?>


    </div>

<div class="row" id="entrada" style="float:left; width:50%;">

        <?php echo $form->labelEx($modelCasoPrueba,'nombre_archivo_entrada',array('label'=>'Archivo de entrada')); ?>

        <?php echo $form->fileField($modelCasoPrueba,'nombre_archivo_entrada',array('size'=>60,'maxlength'=>256,"class"=>"lolcat","title"=>"Debe indicar la ubicacion del archivo de entrada")); ?>

        <?php echo $form->error($modelCasoPrueba,'nombre_archivo_entrada'); ?>


    </div>



You can see that both have the same div FileField fields and q refer to the same attribute model so that it would form this information is stored in two models will instantiate q while

a small example plis plis plis!!!

http://www.yiiframework.com/doc/guide/1.1/en/form.table

You could give me a brief explanation of how it works? and try this example but do not quite understand please. I do not understand certain things especially the part where the view foreach is set for fields