Beispiel #1
0
 /**
  * Performs ajax validation.
  * @param AccountForm $model
  * @throws \yii\base\ExitException
  */
 protected function performAjaxValidation($model)
 {
     if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
         Yii::$app->response->format = Response::FORMAT_JSON;
         echo json_encode(ActiveForm::validate($model));
         Yii::$app->end();
     }
 }