Pagination with Custom model |
Ok, it wasn’t clear your model do not extend CodeIgniter’s model. We just see one function.
If you really don’t want to extend the Model class you can take a look at how the pagination is implemented in this class: https://github.com/codeigniter4/CodeIgni....php#L1165 You will need to use the Pager service. You can’t call findAll() because it’s part of the Model class, so you will need to call the limit() function of the query builder to set the limit and offset for the select query. PHP Code: /**
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Welcome Guest, Not a member yet? Register Sign In |