Difference between #7 and #8 of
How to use Multiple instances of the same model in the same form

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

[...]
// Set attribute for user data
$model->attributes=$_POST['User'];

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

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

if($valid)
{
$addressModel_1->save();
$addressModel_2->save();
[...]
10 3
23 followers
Viewed: 93 174 times
Version: 1.1
Category: How-tos
Written by: kiran sharma
Last updated by: Maurizio Domba Cerin
Created on: Aug 1, 2012
Last updated: 12 years ago
Update Article

Revisions

View all history