Guest::giveControllerResponse

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Guest
  4. giveControllerResponse
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/sitebutton/guest.php
  • Класс: Bitrix\Crm\SiteButton\Guest
  • Вызов: Guest::giveControllerResponse
static function giveControllerResponse(array $data = array(), $isError = false)
{
	global $APPLICATION;
	$APPLICATION->restartBuffer();

	$origin = Context::getCurrent()->getServer()->get('HTTP_ORIGIN');
	if ($origin)
	{
		header('Access-Control-Allow-Origin: ' . $origin);
		header('Access-Control-Allow-Credentials: true');
	}


	header('Content-Type: application/json; charset=UTF-8');
	echo Json::encode(array('error' => $isError, 'data' => $data));
	\CMain::finalActions();
	exit;
}

Добавить комментарий