0
votes

Im using KNP Paginator Bundle, it works fine, but I cant make works the limit records per page (dynamically), I have readed and tried this post Dynamic limit per page Knp Pagination, but no luck. Someone can help me?

2
KNPPaginatorBundle gives you an option to set the limit. You can set that value according to your logic. Can you please be more precise on your requirement and share some code? - Jeet
Jeet, that option limit works very well, I need to let the user change it from the website, something like this: <select name="maxItemPerPage" id="maxItemPerPage"> <option id="10">10</option> <option id="20">20</option> <option id="30">30</option> </select>, you know like bootstrap datatables. - Pedro Elias Aguilar

2 Answers

0
votes

I answered in your other post too:

$pagination = $paginator->paginate(
        $query, /* query NOT result */
        $request->query->getInt('page', 1)/*page number*/,
        10/*limit per page*/
);

The last parameter 10, sets the number of items shown per page as I answered per your other post.

0
votes

After some days of researching, I used bootstrap datatables classes and javascript functions to make work "limit per page" and "search input text" friendly to user.