Welcome Guest, Not a member yet? Register   Sign In
what I'm doing wrong
#3

Thank you so much, that worked, I had that to see if works,
Now trying to get that into paging, but getting error

$postModel = new \App\Models\ListingsModel();
$data = $postModel->getpostsbyuser(2);

$params = [
'listings' => $data->paginate(10),
'pager' => $data->pager,
'total' => $data->countAllResults(),
'page' => isset($_GET['page']) ? $_GET['page'] : 1,
'perPage' => 12
];
return view('default', $params );

Getting error:
Call to a member function paginate() on array

Thanks again for any help
Reply


Messages In This Thread
what I'm doing wrong - by lindaw - 02-04-2023, 07:50 AM
RE: what I'm doing wrong - by biker64 - 02-04-2023, 09:00 AM
RE: what I'm doing wrong - by lindaw - 02-04-2023, 09:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB