As far I understood you want render this peace ofthe following code in multiple <divs>
.
$page_array['photo_gallery_arguments'] = array(
'#title' => t('All photos from ever'),
'#items' => $items,
// Theme hook with suggestion.
'#theme' => 'item_list',
'#type' => 'div',
);
in series of divs ... So change those peace ofReplace it with the following code on this:.
foreach($items as $item_key => $item) {
$page_array['photo_gallery_arguments'][$item_key] = array(
'#type' => 'container',
'#attributes' => array(
'class' => array(
'my-class-' . $item_key,
),
),
);
$page_array['photo_gallery_arguments'][$item_key]['content'] = array(
'#type' => 'markup',
'#markup' => $item,
);
}
OR another variant with 'markup':Or use the following code.
foreach($items as $item_key => $item){
$page_array['photo_gallery_arguments'][$item_key] = array(
'#type' => 'markup',
'#markup' => '<div class="my-class-"' . $item_key . '>' . $item . '</div>',
);
}
OR another variant - divs without classes:Alternatively, you can use the following code.
foreach($items as $item_key => $item){
$page_array['photo_gallery_arguments'][$item_key] = array(
'#type' => 'item',
'#markup' => $item,
);
}
P.S. readYou can find more information about Render Arraysrendering arrays , also some elements described atand Form API.