From 85cc75aaa2873601e769d3e06d3b881882fbd627 Mon Sep 17 00:00:00 2001 From: "Charles Q. Wu" Date: Sun, 16 Apr 2017 16:07:59 -0700 Subject: [PATCH] docs/guide/input-multiple-models: added a note on avoiding validating the same input data with the same rules more than once (#13995) [skip ci] --- docs/guide/input-multiple-models.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/guide/input-multiple-models.md b/docs/guide/input-multiple-models.md index 509abac..f6b5f1e 100644 --- a/docs/guide/input-multiple-models.md +++ b/docs/guide/input-multiple-models.md @@ -59,8 +59,10 @@ class UserController extends Controller ``` In the `update` action, we first load the `$user` and `$profile` models to be updated from the database. We then call -[[yii\base\Model::load()]] to populate these two models with the user input. If successful we will validate -the two models and save them. Otherwise we will render the `update` view which has the following content: +[[yii\base\Model::load()]] to populate these two models with the user input. If loading is successful, we will validate +the two models and then save them — please note that we use `save(false)` to skip over validations inside the models +as the user input data have already been validated. If loading is not successful, we will render the `update` view which +has the following content: ```php