• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/component_template.php
  • Класс: CBitrixComponentTemplate
  • Вызов: CBitrixComponentTemplate::EndViewTarget
public function EndViewTarget()
{
	/** @global CMain $APPLICATION */
	global $APPLICATION;

	$view = &$this->__view;
	if(!empty($view))
	{
		//Get the key to last started view target
		end($view);
		$target_key = key($view);

		//Get the key to last added "sub target"
		//in most cases there will be only one
		end($view[$target_key]);
		$sub_target_key = key($view[$target_key]);

		$sub_target = &$view[$target_key][$sub_target_key];
		if($sub_target[0] === false)
		{
			$sub_target[0] = ob_get_contents();
			$APPLICATION->AddViewContent($target_key, $sub_target[0], $sub_target[1]);
			$this->__component->addViewTarget($target_key, $sub_target[0], $sub_target[1]);
			ob_end_clean();
		}
	}
}