Browse Source

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]

tags/2.0.12
Charles Q. Wu 8 years ago committed by Alexander Makarov
parent
commit
85cc75aaa2
  1. 6
      docs/guide/input-multiple-models.md

6
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
<?php

Loading…
Cancel
Save