For example, the catalog page, where 69 pages.
The pagination component is connected only in the body of the page, where you can get the total number of pages.
But you need to get their number in heder. How to do it?
I read, it seems like through the deferred functions this is implemented, but I did not find suitable examples.
In the pagination template posted code:
<?php $this->SetViewTarget('nav_page_count');?> <?php $APPLICATION->AddViewContent('nav_page_count', $arResult["NavPageCount"]);?> <?php $this->EndViewTarget();?> In header.php I get what I want:
$APPLICATION->ShowViewContent('nav_page_count') Everything is good, but this number is simply displayed in the form of content, but I need not to display, but to work as with a variable.
How to get this data as a variable?


$var = $APPLICATION->ShowViewContent('nav_page_count')- Nikolaj Sarry