CI4 with join and pagination |
08-21-2021, 06:57 PM
(This post was last modified: 08-21-2021, 07:06 PM by spreaderman. Edit Reason: Mistakenly thought was code was still incorrect, however, it was correct and the code works. )
Thank you for the code snippet. I realized I was not making a model object properly. I read a bit more and found this link; https://stackoverflow.com/questions/6527...wing-error It says pagination only works on model objects (far above I was creating a builder object). I have revised my model and controller per below. It is now working. Thank you.
Code: function index(){ and this is my new method in the model; Code: function paginatePosts($post_category_id = null, $category_is_published = 1, $post_is_published = 1, $articles_per_page =6 ) { and there is my call to echo links to the view; Code: <?= $pager->links('bootstrap', 'bootstrap4_pagination'); ?> |
Messages In This Thread |
CI4 with join and pagination - by spreaderman - 08-20-2021, 06:43 PM
RE: CI4 with join and pagination - by InsiteFX - 08-21-2021, 12:52 AM
RE: CI4 with join and pagination - by spreaderman - 08-21-2021, 01:20 AM
RE: CI4 with join and pagination - by paliz - 08-21-2021, 01:23 PM
RE: CI4 with join and pagination - by spreaderman - 08-21-2021, 06:57 PM
|