本文整理匯總了PHP中CBitrixComponent::setSiteTemplateId方法的典型用法代碼示例。如果您正苦於以下問題:PHP CBitrixComponent::setSiteTemplateId方法的具體用法?PHP CBitrixComponent::setSiteTemplateId怎麽用?PHP CBitrixComponent::setSiteTemplateId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CBitrixComponent
的用法示例。
在下文中一共展示了CBitrixComponent::setSiteTemplateId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: includeComponent
public static function includeComponent($componentName, $componentTemplate, $arParams = array(), $parentComponent = null, $arFunctionParams = array())
{
$componentRelativePath = \CComponentEngine::MakeComponentPath($componentName);
if (StrLen($componentRelativePath) <= 0) {
return False;
}
if (is_object($parentComponent)) {
if (!$parentComponent instanceof \cbitrixcomponent) {
$parentComponent = null;
}
}
$result = null;
$bComponentEnabled = !isset($arFunctionParams["ACTIVE_COMPONENT"]) || $arFunctionParams["ACTIVE_COMPONENT"] != "N";
$component = new \CBitrixComponent();
if ($component->InitComponent($componentName)) {
$obAjax = null;
if ($bComponentEnabled) {
$component->setSiteId(static::getInstance()->getSiteId());
$component->setLanguageId(static::getInstance()->getLanguageId());
$component->setSiteTemplateId(static::getInstance()->getSiteTemplateId());
$result = $component->IncludeComponent($componentTemplate, $arParams, $parentComponent);
$arThemeCss = array();
// TODO: use styles array from $component
foreach ($arThemeCss as $cssPath) {
static::getInstance()->setStyle($cssPath);
}
}
}
return $result;
}