![]() |
How do I replace the default pagination with a pager? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: How do I replace the default pagination with a pager? (/showthread.php?tid=80210) |
How do I replace the default pagination with a pager? - Ajax30 - 09-28-2021 I am working on an online newspaper/blogging application (link to GitHub repo) with CodeIgniter 3.1.8 and Twitter Bootstrap 4. The application has themes. One of the themes uses a pager instead of pagination, so the Codeigniter default pagination is not well suited for it. The "hack" I found for this problem relies on CSS. In the Posts controller I have: Code: class Posts extends CI_Controller Code: .pagination li:first-child { The problem with this approach is that it is inconsistent: when I am on the last page, the "Newer Posts" button is linked to the first page instead of the previous. Question: Is there a more reliable way to add a pager option? RE: How do I replace the default pagination with a pager? - InsiteFX - 09-29-2021 You can take a look at this, you will need to modify it to work wit CodeIgniter but all code is there. How to create Pagination with PHP It only displays the Prev and Next buttons. RE: How do I replace the default pagination with a pager? - InsiteFX - 09-30-2021 Sorry, I just remembered that I had created a Bootstrap bs_simple.php Pager template for it Here are the templates for bootstrap. You will need to configure then in the app/Config/Pager.php file. PHP Code: <?php |