• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/assets/preprocessing/lazyload.php
  • Класс: BitrixLandingAssetsPreProcessingLazyload
  • Вызов: Lazyload::getSrcByBgStyle
static function getSrcByBgStyle($style)
{
	if (preg_match_all(
		'/url('*([^']+)'*)s*([d]*x*)/is',
		$style,
		$matches
	))
	{
		$result = [];
		for ($i = 0, $c = count($matches[1]); $i < $c; $i++)
		{
			if ($matches[2][$i] == '2x')
			{
				$result['src2x'] = $matches[1][$i];
			}
			else
			{
				$result['src'] = $matches[1][$i];
			}
		}

		if(!empty($result['src']))
		{
			return $result;
		}
	}

	return false;
}