fix validator bug on recovery controller

This commit is contained in:
Antonio Ramirez
2017-06-15 01:44:58 +02:00
parent 53a3a72cc5
commit 50681953c2
2 changed files with 7 additions and 8 deletions

View File

@ -30,12 +30,11 @@ class AjaxRequestModelValidator implements ValidatorInterface
{
$request = Yii::$app->request;
if ($request->getIsAjax() && !$request->getIsPjax()) {
if ($this->model->load($request->post())) {
Yii::$app->response->format = Response::FORMAT_JSON;
echo json_encode(ActiveForm::validate($this->model));
Yii::$app->end();
}
if ($request->getIsAjax() && $this->model->load($request->post())) {
Yii::$app->response->format = Response::FORMAT_JSON;
Yii::$app->response->data = ActiveForm::validate($this->model);
Yii::$app->response->send();
Yii::$app->end();
}
}
}