当前位置: 首页>>代码示例>>PHP>>正文


PHP CBitrixComponent::IncludeComponent方法代码示例

本文整理汇总了PHP中CBitrixComponent::IncludeComponent方法的典型用法代码示例。如果您正苦于以下问题:PHP CBitrixComponent::IncludeComponent方法的具体用法?PHP CBitrixComponent::IncludeComponent怎么用?PHP CBitrixComponent::IncludeComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBitrixComponent的用法示例。


在下文中一共展示了CBitrixComponent::IncludeComponent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: IncludeComponent

 function IncludeComponent($componentName, $componentTemplate, $arParams = array(), $parentComponent = null, $arFunctionParams = array())
 {
     /** @global CMain $APPLICATION */
     global $APPLICATION, $USER;
     if (is_array($this->arComponentMatch)) {
         $skipComponent = true;
         foreach ($this->arComponentMatch as $cValue) {
             if (strpos($componentName, $cValue) !== false) {
                 $skipComponent = false;
                 break;
             }
         }
         if ($skipComponent) {
             return false;
         }
     }
     $componentRelativePath = CComponentEngine::MakeComponentPath($componentName);
     if (StrLen($componentRelativePath) <= 0) {
         return False;
     }
     if ($_SESSION["SESS_SHOW_INCLUDE_TIME_EXEC"] == "Y" && ($USER->CanDoOperation('edit_php') || $_SESSION["SHOW_SQL_STAT"] == "Y")) {
         $debug = new CDebugInfo();
         $debug->Start();
     } elseif ($APPLICATION->ShowIncludeStat) {
         $debug = new CDebugInfo();
         $debug->Start();
     } else {
         $debug = null;
     }
     if (is_object($parentComponent)) {
         if (!$parentComponent instanceof cbitrixcomponent) {
             $parentComponent = null;
         }
     }
     $bDrawIcons = (!isset($arFunctionParams["HIDE_ICONS"]) || $arFunctionParams["HIDE_ICONS"] != "Y") && $APPLICATION->GetShowIncludeAreas();
     if ($bDrawIcons) {
         echo $this->IncludeStringBefore();
     }
     $result = null;
     $bComponentEnabled = !isset($arFunctionParams["ACTIVE_COMPONENT"]) || $arFunctionParams["ACTIVE_COMPONENT"] != "N";
     $component = new CBitrixComponent();
     if ($component->InitComponent($componentName)) {
         $obAjax = null;
         if ($bComponentEnabled) {
             if ($arParams['AJAX_MODE'] == 'Y') {
                 $obAjax = new CComponentAjax($componentName, $componentTemplate, $arParams, $parentComponent);
             }
             $result = $component->IncludeComponent($componentTemplate, $arParams, $parentComponent);
         }
         if ($bDrawIcons) {
             $panel = new CComponentPanel($component, $componentName, $componentTemplate, $parentComponent, $bComponentEnabled);
             $arIcons = $panel->GetIcons();
             echo $s = $this->IncludeStringAfter($arIcons["icons"], $arIcons["parameters"]);
         }
         if ($bComponentEnabled && $obAjax) {
             $obAjax->Process();
         }
     }
     if ($_SESSION["SESS_SHOW_INCLUDE_TIME_EXEC"] == "Y" && ($USER->CanDoOperation('edit_php') || $_SESSION["SHOW_SQL_STAT"] == "Y")) {
         echo $debug->Output($componentName, "/bitrix/components" . $componentRelativePath . "/component.php", $arParams["CACHE_TYPE"] . $arParams["MENU_CACHE_TYPE"]);
     } elseif (is_object($debug)) {
         $debug->Stop($componentName, "/bitrix/components" . $componentRelativePath . "/component.php", $arParams["CACHE_TYPE"] . $arParams["MENU_CACHE_TYPE"]);
     }
     return $result;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:65,代码来源:main.php

示例2: 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;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:30,代码来源:eventmessagethemecompiler.php


注:本文中的CBitrixComponent::IncludeComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。