V
V
viktorulyushev2016-11-29 16:37:16
1C-Bitrix
viktorulyushev, 2016-11-29 16:37:16

Bitrix.How to get infoblock element id?

I have an infoblock, it has elements, I need to find out the id of these elements and put them in a loop, what will the call example look like?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Maksimenko, 2016-11-29
@olegprof

<?php

if (\Bitrix\Main\Loader::includeModule('iblock')) {
    
    $elementIterator = \Bitrix\Iblock\ElementTable::getList([
        'select' => [
            '*',
        ],
        'filter' => [
            '=IBLOCK_ID' => 1,
        ]
    ]);
    
    foreach ($elementIterator->fetchAll() as $element) {
        echo '<pre>';print_r($element);echo '</pre>';
    }
    
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question