Bitrix Site Manager

CBitrixComponent::InitComponentTemplate

bool
InitComponentTemplate([
 string templatePage]
);

The method initializes the component template. After calling this method, a template object can be obtained using CBitrixComponent::GetTemplate. In this case, the component template is included using CBitrixComponent::ShowComponentTemplate.

If the component does not require template, use CBitrixComponent::IncludeComponentTemplate which initializes and includes the template at a single call.

Parameters

Parameter Description
templatePage The name of a component template page. For compound components, this parameter must be specified. For simple components, it may be an empty string or may be omitted.

Return Values

Returns true on success, or false otherwise.

Example

if ($this->InitComponentTemplate($templatePage))
{
	$template = & $this->GetTemplate();
	$folderPath = $template->GetFolder();
	if (strlen($folderPath) > 0)
	{
		* * *
	}
	$this->ShowComponentTemplate();
}

See Also

  • CBitrixComponent::ShowComponentTemplate
  • CBitrixComponent::GetTemplate
  • CBitrixComponent::IncludeComponentTemplate