mardi 1 mars 2016

Multiple Laravel 5 Pagination within the same page

I have a container that I want to fill with items from my database, say every row has these columns:

$item->title
$item->description
$item->color
$item->id

I have a main-container where I want to loop through all of my items, but only 5 at a time. I know I can have all of them, but I really want there to be no scrolling.

I know for a whole page you would just replace ->get(); with ->paginate(x); where x is the number of items you want to show per page.

But I also have a secondary-container where I want to loop through a bunch of other items, but I wouldn't know how to implement the second one, since the main-container would work when the url extends ?page=x where x is the nth chunk of items iterated.

Would I be able to have a custom get url request (not sure about the term, correct me if I'm wrong) and do something like ?page2=x for my secondary-container?

I searched arround but didn't quite know how to put my question into a small answer, and the results weren't helpful. Thank you in advance.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1RizWHT
via IFTTT

Aucun commentaire:

Enregistrer un commentaire