Skip to content

Instantly share code, notes, and snippets.

@abramovantonru
Last active January 26, 2017 12:15
Show Gist options
  • Save abramovantonru/1094ee86422c79c8cc1423b0aa7584eb to your computer and use it in GitHub Desktop.
Save abramovantonru/1094ee86422c79c8cc1423b0aa7584eb to your computer and use it in GitHub Desktop.
get buffer of component template {template, php, bitrix, func}
<?
/**
* 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