Is there a good approach to handling a one-to-many relationship with displaying data in a form? For example, I have a record in the database for a customer that has many appointments. Is there a way to get all the appointments through the entity of the form elegantly? Yii does it by :

<?php foreach($items as $i=>$item): ?>
<tr>
<td><?php echo CHtml::activeTextField($item,"[$i]name"); ?></td>
<td><?php echo CHtml::activeTextField($item,"[$i]price"); ?></td>
<td><?php echo CHtml::activeTextField($item,"[$i]count"); ?></td>
<td><?php echo CHtml::activeTextArea($item,"[$i]description"); ?></td>
</tr>
<?php endforeach; ?>

Thanks!