• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/web/webpacker/resource/package.php
  • Класс: BitrixMainWebWebPackerResourcePackage
  • Вызов: Package::toArray
public function toArray($type = null)
{
	$result = [];
	foreach ($this->list as $asset)
	{
		if ($type && $asset->getType() != $type)
		{
			continue;
		}

		$path = $asset->getUri();
		if ($this->onDemand && !$path)
		{
			continue;
		}

		$content = $asset->getContent();
		if (!$this->onDemand && !$content)
		{
			continue;
		}

		$result[] = [
			'type' => $asset->getType(),
			'path' => $path,
			'content' => $content,
			'cache' => true,
		];
	}

	return $result;
}