original_string: protected function performAjaxValidation($model)
      {
          $result = ($model instanceof Model)
              ? ActiveForm::validate($model)
              : ActiveForm::validateMultiple($model);
  
          $response = Yii::$app->getResponse();
  
          if (!empty($result) && $ajaxRedirect = Yii::$app->getSession()->get('site_ajax_redirect')) {
              $response = $response->redirect($ajaxRedirect);
              Yii::$app->getSession()->remove('site_ajax_redirect');
          } else {
              $response->format = Response::FORMAT_JSON;
              $response->data = $result;
          }
  
          return $response;
      }
code: protected function performAjaxValidation($model)
      {
          $result = ($model instanceof Model)
              ? ActiveForm::validate($model)
              : ActiveForm::validateMultiple($model);
  
          $response = Yii::$app->getResponse();
  
          if (!empty($result) && $ajaxRedirect = Yii::$app->getSession()->get('site_ajax_redirect')) {
              $response = $response->redirect($ajaxRedirect);
              Yii::$app->getSession()->remove('site_ajax_redirect');
          } else {
              $response->format = Response::FORMAT_JSON;
              $response->data = $result;
          }
  
          return $response;
      }
code_tokens: protected function performAjaxValidation ( $ model ) { $ result = ( $ model instanceof Model ) ? ActiveForm :: validate ( $ model ) : ActiveForm :: validateMultiple ( $ model ) ; $ response = Yii :: $ app -> getResponse ( ) ; if ( ! empty ( $ result ) && $ ajaxRedirect = Yii :: $ app -> getSession ( ) -> get ( 'site_ajax_redirect' ) ) { $ response = $ response -> redirect ( $ ajaxRedirect ) ; Yii :: $ app -> getSession ( ) -> remove ( 'site_ajax_redirect' ) ; } else { $ response -> format = Response :: FORMAT_JSON ; $ response -> data = $ result ; } return $ response ; }
docstring: Performs ajax validation
  
  @param $model
  @return \yii\console\Response|\yii\web\Response
docstring_tokens: Performs ajax validation