Difference between #2 and #3 of
Creating and updating model and its related models in one form, inc. image

Changes

Title unchanged

Creating and updating model and its related models in one form, inc. image

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

multiple models, one to many, Image upload

Content changed

[...]
$success_saving_all = false;
}

if ($success_saving_all) {
// everything's done. Would you believe it?! Go to 'view' page :)
$success_msg = (count($songs_to_save) > 0) ? "Artist and song records has been created successfully!" : "Artist record has been created successfully!";
 
Yii::app()->user->setFlash('success', Yii::t("MusicModule.forms", $success_msg));
 
$this->redirect(array("view", "id" => $model->id));
}
}
[...]
if ($success_saving_all) {
$success_msg = (count($songs_to_save) > 0) ? "Artist and song records have been updated" : "Artist record have been updated";
 
Yii::app()->user->setFlash('success', Yii::t("MusicModule.forms", $success_msg));
 
$this->redirect(array("view", "id" => $model->id));
}
}
}
else {
// initial rendering of update form. prepare songs for printing.
[...]
6 1
21 followers
Viewed: 178 223 times
Version: 1.1
Category: How-tos
Written by: Boaz
Last updated by: Boaz
Created on: Sep 9, 2012
Last updated: 12 years ago
Update Article

Revisions

View all history