noganno
10/28/2015 - 6:21 AM

пагинация в битрикс https://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/getpagenavstringex.php

CModule::IncludeModule('iblock');
$arSort = array();
$arFilter = array('IBLOCK_ID'=> '1');
$arNavParams = array(
        "nPageSize" => '2',
        "bDescPageNumbering" => 'Описание',
        "bShowAll" => 'Y',
    );  

$arSelect = array("ID", "NAME");
$rsElement = CIBlockElement::GetList($arSort, $arFilter, false, $arNavParams, $arSelect);
$NAV_STRING = $rsElement->GetPageNavStringEx($navComponentObject, 'Заголовок', '', 'Y');
echo $NAV_STRING."
";
while($arElem = $rsElement->Fetch())
{
   echo $arElem['ID']."__".$arElem["NAME"]."
";
}
echo $NAV_STRING;


// Пример использования в компонентах 2.0

$rsElements = CIBlockElement::GetList($arSort, $arFilter, false, array("nPageSize" => $arParams["PAGE_COUNT"], "bShowAll" => false), $arSelect);
....
$arResult["NAV_STRING"] = $rsElements->GetPageNavStringEx($navComponentObject, "", $arParams["PAGER_TEMPLATE"]);