コード例 #1
0
ファイル: class.php プロジェクト: digitalwand/mvc.base
 /**
  * Отправляет результат запроса на клиент
  * @internal
  */
 protected function sendAjaxResponse()
 {
     $response = $this->arResult['AJAX'];
     if ($response !== self::SKIP_AJAX_EXECUTION) {
         if (is_array($response) and !isset($response['success'])) {
             $response['success'] = true;
         } elseif (is_bool($response)) {
             $response = array('success' => $response);
         } else {
             $response = array('success' => true, 'data' => $response);
         }
         $this->app->RestartBuffer();
         print json_encode($response);
         exit;
     }
 }