public function actionValidateRestorepswForm() { $rstFrm = new RestorePswForm(); if (Yii::$app->request->isAjax && $rstFrm->load(Yii::$app->request->post())) { Yii::$app->response->format = Response::FORMAT_JSON; return ActiveForm::validate($rstFrm); } }
public function actionRestorepsw() { $rstFrm = new RestorePswForm(); if ($rstFrm->load(Yii::$app->request->post()) && $rstFrm->validate()) { $ok = $rstFrm->restorePsw(); if ($ok) { return $this->redirect(Url::to('/?mid=2')); } } return $this->goHome(); }