Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

how to paginate merge arrays ?


Reply

3 Posts   510 Views

Avatar
snaip

29 November 2011 at 12:48am Community Member, 180 Posts

hi

i have to DataObject:

$array = new DataObjectSet();

foreach(.....) {
$produktyPodkategoria = DataObject::get(...)
$array->merge($produktyPodkategoria);
}

$produkty = DataObject::get(...)
$array->merge($produkty);

how to paginate $array ?

this code doesnt work

$pageLength = 8;
$totalSize = count($array);
$array->getRange($SQL_start, $pageLength);
$array->setPageLimits($SQL_start, $pageLength, $totalSize);

Avatar
swaiba

29 November 2011 at 3:12am Forum Moderator, 1796 Posts

does this help?

http://www.ssbits.com/tutorials/2010/paginating-a-filtered-dataobjectset/

Avatar
snaip

30 November 2011 at 3:00am Community Member, 180 Posts

yes !
thank you : ]