I have this form in "user/index":
<?php $form = ActiveForm::begin(['id' => 'form-profile-edit']); ?>
..HTML..
<?= Html::activeTextInput($model, 'email', ['placeholder' => Yii::t("app", "Page_Profile_Email"), 'class' => 'form-control']); ?>
..HTML..
<?php ActiveForm::end(); ?>
Here is my actionIndex on UserController. I am getting forwader with 302 response and id param in my URL (This actions make these in case of success) but dont change my email. If I print $model->email I see the unchanged email, but I see too in my post params that new email was sent ok. Can anybody help me?
public function actionIndex()
{
$model = Yii::$app->user->identity;
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['index', 'id' => $model->id]);
} else {
return $this->render('index', [
'model' => $model,
]);
}
}
My http info:
Request URL:http://myURL/backend/user/index?id=1 (HTTP 302)
_backendCsrf:OEZBZTh1OEV9PgQGZx1raH4TCh0BTG0hXxQkPU8/XHd3dDItaUVpBw==
User[email]:newemail@gmail.com
Sorry my english.