Answer the question
In order to leave comments, you need to log in
How to display items in order using getlist?
Hello !
Tell me how to display elements through CIBlockElement::GetList, so that the elements are displayed 50 per page, but when the page is reloaded, the next 50 elements are displayed
Answer the question
In order to leave comments, you need to log in
but when reloading the page, the following 50 items were displayed
\Bitrix\Main\Loader::includeModule('iblock');
$iblockId = 2;
$nPageSize = 50;
$iNumPage = 1;
$arElements = array();
$dbRes = CIBlockElement::GetList(array('ID' => 'ASC'), array('IBLOCK_ID' => $iblockId), false, array('nPageSize' => $nPageSize, 'iNumPage' => $iNumPage), array('ID', 'NAME'));
while($arRes = $dbRes->Fetch()) {
$arElements[] = $arRes;
}
echo '<pre>';
print_r($arElements);
echo '</pre>';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question