Bob Rockefeller
Bob Rockefeller

Reputation: 4596

Pagination Reference For concrete5 (arrays and lists)?

I'd like to paginate an array (or a list) in concrete5. It will not be a query result, so I don't think the native concrete5 paginator will do what I want.

Is there a reference, or tutorial, somewhere that would show how that would be handled?

Bob

Upvotes: 0

Views: 447

Answers (1)

Jordan Lev
Jordan Lev

Reputation: 2813

I don't know how to do this off the top of my head, but it's certainly possible. The PageList class (which is what you see most tutorials/examples utilize when showing pagination) extends the lower-level DatabaseItemList class, which itself extends the ItemList class. If you look in concrete/core/libraries/item_list.php, you'll see a getPagination function. To make it work with your own list, you'd need to extent the ItemList class yourself. Unfortunately I don't know of a tutorial that explains this (nor is there any documentation). Your best bet is to look at the concrete/core/models/marketplace_remote_item.php file and see how it does its thing (because it's the only example in the core system I can see that extends the plain old ItemList class instead of the DatabaseItemList class).

Upvotes: 1

Related Questions