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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

how to paginate merge arrays ?


Go to End


3 Posts   1585 Views

Avatar
snaip

Community Member, 181 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, 1899 Posts

29 November 2011 at 3:12am

Avatar
snaip

Community Member, 181 Posts

30 November 2011 at 3:00am

yes !
thank you : ]