Difference between #5 and #6 of
How to use Multiple instances of the same model in the same form

Revision #6 has been created by kiran sharma on Aug 3, 2012, 9:24:16 AM with the memo:

comment added
« previous (#5) next (#7) »

Changes

Title unchanged

How to use Multiple instances of the same model in the same form

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

Multiple instances of the same model in the same form, Multiple instances of the same model, Two instances of the same model

Content changed

[...]
{
$addressModel_1->attributes=$_POST['Address'][1]; // Set attribute for home address
$addressModel_2->attributes=$_POST['Address'][2]; // Set attribute for company address
$model->attributes=$_POST['User']; // Set attribute for user data

$valid=$addressModel_1->validate();
  // Validate all three model
$valid=$addressModel_2->validate() && $valid;
$valid=$model->validate() && $valid;
[...]
$model->attributes=$_POST['User']; // Set attribute for user data

$valid=$addressModel_1->validate();
 // Validate all three model
$valid=$addressModel_2->validate() && $valid;
$valid=$model->validate() && $valid;

if($valid)
{
[...]
10 3
23 followers
Viewed: 89 836 times
Version: 1.1
Category: How-tos
Written by: kiran sharma
Last updated by: Maurizio Domba Cerin
Created on: Aug 1, 2012
Last updated: 11 years ago
Update Article

Revisions

View all history