|
|
|
@ -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 |
|
|
|
|