How to use a single form to collect data for two or more models?

Comparing #6 with #7

Revision #7 was created by nups nups on Dec 21, 2010, 5:18:01 AM.

//create.php <?php echo $this->renderPartial('_form', array('a'=>$a,'b'=>$b)); ?>

Content

[...]
And for the `create` view, we would need the following code,


```php
<?php echo CHtml::form(); ?>
 
//create.php
 
<?php echo $this->renderPartial('_form', array('a'=>$a,'b'=>$b)); ?>


<?php echo CHtml::errorSummary(array($a,$b)); ?>

...input fields for $a, $b...
[...]