scenario = "default"; $form->load(\Yii::$app->request->post(), ''); if (!$form->validate()) { throw new BadRequestHttpException( $form->getErrorSummary(false)[0]); } $customer = Customer::findOne(\Yii::$app->user->id); if (!$customer->validatePassword($form->passwordOld)) { throw new BadRequestHttpException("Jelenlegi jelszó nem egyezik", "2"); } $customer->setPassword($form->password); $customer->save(); } }