• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/component_template.php
  • Класс: CBitrixComponentTemplate
  • Вызов: CBitrixComponentTemplate::Init
public function Init(&$component, $siteTemplate = false, $customTemplatePath = "")
{
	global $arBXRuntimeTemplateEngines;

	$this->__bInited = false;

	if ($siteTemplate === false)
	{
		$this->__siteTemplate = $component->getSiteTemplateId();
	}
	else
	{
		$this->__siteTemplate = $siteTemplate;
	}

	if ($this->__siteTemplate == '')
		$this->__siteTemplate = ".default";

	$this->__file = "";
	$this->__fileAlt = "";
	$this->__folder = "";

	if (!$arBXRuntimeTemplateEngines)
		$this->InitTemplateEngines();

	if (!($component instanceof cbitrixcomponent))
		return false;

	$this->__component = &$component;

	$this->__name = $this->__component->GetTemplateName();
	if ($this->__name == '')
		$this->__name = ".default";

	$this->__name = preg_replace("'[\\/]+'", "/", $this->__name);
	$this->__name = trim($this->__name, "/");

	if (!self::CheckName($this->__name))
		$this->__name = ".default";

	$this->__page = $this->__component->GetTemplatePage();
	if ($this->__page == '')
		$this->__page = "template";

	if (!$this->__SearchTemplate($customTemplatePath))
		return false;

	$this->__GetTemplateEngine();

	$this->__bInited = true;

	return true;
}