Last active
January 26, 2017 12:15
-
-
Save abramovantonru/1094ee86422c79c8cc1423b0aa7584eb to your computer and use it in GitHub Desktop.
get buffer of component template {template, php, bitrix, func}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
/** | |
* Get buffer of bitrix component template | |
* @param CBitrixComponent $component | |
* @param CBitrixComponent $arParams | |
* @return string $template | |
*/ | |
function getTemplate(&$component, &$arParams){ | |
ob_start(); | |
if($arParams['TEMPLATE'] == 'LIST') | |
$component->IncludeComponentTemplate('list'); | |
else if($arParams['TEMPLATE'] == 'DETAIL') | |
$component->IncludeComponentTemplate('detail'); | |
$template = ob_get_contents(); | |
ob_end_clean(); | |
return $template; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment