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   538 Views

Avatar
snaip

Community Member, 180 Posts

29 November 2011 at 12:48am

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

Forum Moderator, 1799 Posts

29 November 2011 at 3:12am

does this help?

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

Avatar
snaip

Community Member, 180 Posts

30 November 2011 at 3:00am

yes !
thank you : ]