![]() |
Pagination - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Pagination (/showthread.php?tid=78756) |
Pagination - 1stian - 03-07-2021 Hello everyone, I am new to Codeigniter 4... And I'am trying to figure this pagination out... I've got this function, and it works as it should: PHP Code: public function butikk() But this grabs everything from my table. I've different types of content in that table, differences with 1,2 or 3 as value in a column named type. My model: PHP Code: public function getOvner($id = false, $type = 1) So what I discovered was, when using "->pagination" in my controller, it totally ignores what I've got in my model. This is obviously because it never runs this function. How can I implement this? So it only grabs lets say type 1. Thanks in advance! Regards Stian. RE: Pagination - iRedds - 03-08-2021 The getOvner method returns the result. For pagination to work based on your request, you only need to prepare the request, not return it. Which implies using only QueryBuilder. PHP Code: // model method RE: Pagination - 1stian - 03-08-2021 (03-08-2021, 12:29 AM)iRedds Wrote: The getOvner method returns the result. For pagination to work based on your request, you only need to prepare the request, not return it. Which implies using only QueryBuilder. Thank you very much! ![]() |