Welcome Guest, Not a member yet? Register   Sign In
Need Help
#1

Hello all!! I hope someone can help me really quick here!

So this is my case,

I've got a table of items, and the items have 4 different types. And I've got a column named types, the value that differs in that column are from 1 to 4.

So with this part:

$model = new ButikkModel();

$data['currentPage'] = $this->request->getVar('ovn_page') ? $this->request->getVar('ovn_page') : 1;

$data = [

'ovner' => $model->where('type', '1')

->orderBy('created_at', 'DESC')

->findAll(),

'pager' => $model->pager

];



it grabs the items just fine, that has type "1". But I can't pagination this... How would I go ahead and do this? Normally you can just add ->pagination after $model, but can't do that because it's an array when using findAll().



Anyone?
Reply
#2

(This post was last modified: 10-26-2021, 03:40 AM by includebeer.)

Call paginate() instead of findAll(). You can see an example on how to do pagination in this tutorial: https://includebeer.com/en/blog/how-to-b...r-4-part-4

@Milina I move the thread in General Help. This had nothing to do with installation problems.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#3

(This post was last modified: 10-29-2021, 04:18 AM by John_Betong.)

I hope you received some help with it.
Did you?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB