How to create pagination on CI4 |
Thank you! Amazing how a simple detail changes everything. As soon as I saw your post the solution to my problem came complete at once.
In addition to the model that collects the table data, I created another one where the table fields are selected according to the search argument. PHP Code: <?php namespace App\Controllers; There is still a pending detail. In the page header I inform the number of items listed in relation to the total pages: 1->20 of 1426 titles, for example, but I need the segment number instead of the query parameter: http://localhost/ci4/albumlists/genre1/2384/20 instead http://localhost/ci4/albumlists/genre1/2384?page=2 PHP Code: <? php The manual has an example how I can use the segment number instead of the query parameter that would resolve the pending issue, but I'm an old man, everything is slow, I still can't understand where the change is made and how. <?= $ pager->makeLinks($ page, $ perPage, $ total, 'template_name', $ segment)?> "When you look at an abyss for a long time, the abyss looks at you." (Nietzsche) From time to time I will look at this but only a little. Once again, thank you very much! |
Welcome Guest, Not a member yet? Register Sign In |