Browse Source

Merge pull request #9636 from icron/doc-show-all-errors

Show errors from all models
9899-cache-bug
Carsten Brandt 9 years ago
parent
commit
99fc362e10
  1. 4
      docs/guide/input-multiple-models.md

4
docs/guide/input-multiple-models.md

@ -37,7 +37,9 @@ class UserController extends Controller
$profile->scenario = 'update';
if ($user->load(Yii::$app->request->post()) && $profile->load(Yii::$app->request->post())) {
if ($user->validate() && $profile->validate()) {
$isValid = $user->validate();
$isValid = $profile->validate() && $isValid;
if ($isValid) {
$user->save(false);
$profile->save(false);
return $this->redirect(['user/view', 'id' => $id]);

Loading…
Cancel
Save