frontend\modules\user\controllers\SettingController::performAjaxValidation PHP Méthode

performAjaxValidation() protected méthode

Performs ajax validation.
protected performAjaxValidation ( frontend\modules\user\models\AccountForm $model )
$model frontend\modules\user\models\AccountForm
    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();
        }
    }