• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/page/asset.php
  • Класс: BitrixMainPageAsset
  • Вызов: Asset::addString
function addString($str, $unique = false, $location = AssetLocation::AFTER_JS_KERNEL, $mode = null)
{
	if ($str == '')
	{
		return false;
	}

	if ($unique)
	{
		$chkSum = md5($str);
		$this->strings[$location][$chkSum]['CONTENT'] = $str;
		$this->strings[$location][$chkSum]['TARGET'][] = $this->getTargetName();
		$this->strings[$location][$chkSum]['MODE'] = $mode;
	}
	else
	{
		$this->strings[$location][] = ['CONTENT' => $str, 'MODE' => $mode, 'TARGET' => [$this->getTargetName()]];
	}
	return true;
}