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

how to paginate merge arrays ?


Go to End
Reply


3 Posts   794 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, 1830 Posts

29 November 2011 at 3:12am

Avatar
snaip

Community Member, 180 Posts

30 November 2011 at 3:00am

yes !
thank you : ]