R
R
rizzli2015-08-21 18:30:18
PHP
rizzli, 2015-08-21 18:30:18

Bitrix. How to pass the result of the component to the header.php of the template?

I ask you not to kick much) In php, and even more so in Bitrix, there is a complete zero, but they asked for help.
In the template.php of the smartfilter component, there is a variable $x (string) where the result of the component is placed.
Is it possible to somehow put this $x variable into a global object (or something else) to use it in the header.php of the template?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Maksimenko, 2015-08-23
@rizzli

In header.php:
In the template.php of the smartfilter component:

$arResult['VAR_X'] = $x;

// some code

$this->__component->setResultCacheKeys(array('VAR_X'));

In component_epilog.php of the smartfilter component:
$APPLICATION->AddViewContent('var-x', $arResult['VAR_X']);

V
Vitaliy K, 2016-08-10
@revenger

Through global variables
www.khtulhu.org.ua/veb-programmirovanie/554-bitrik...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question