34k+
News
Guide
API
Wiki
Forum
Community
Places
Members
Hall of Fame
Badges
More
Learn
Books
Resources
Develop
Download Yii
Extensions
Report an Issue
Report a Security Issue
Contribute to Yii
Donate
About
Release Cycle
License
Team
Official Logos and Design
Login
How to use a single form to collect data for two or more models?
Comparing
#6
with
#7
Revision #7 was created by
nups
on Dec 21, 2010, 5:18:01 AM.
//create.php <?php echo $this->renderPartial('_form', array('a'=>$a,'b'=>$b)); ?>
« Previous (#6)
Next (#8) »
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...
[...]