Welcome Guest, Not a member yet? Register   Sign In
Pagination using ajax in codeigniter 4

Well then; i will use the default pagination which comes with codeigniter 4 but i really do need assistance as the tutorials am seeing online, pagination is created by accessing the model directly like so.

PHP Code:
What if i have a custom query in StockModel.php

PHP Code:
public function stockphotopagination($where) {
 $builder $this->db->table("stock_photos")

And in the StockController.php

PHP Code:
public function home() {
  $model = new StockModel();
  $where = [
   "deletion" "no",
   "display" => "yes"
  $query $model->stockphotopagination($where);
  $data['results'] = $query;
  echo view('views/home'$data);

And in home.php view:

PHP Code:
foreach($results as $row) {
  echo $row['
]. '<br>';

How do i create pagination for this?

Messages In This Thread
RE: Pagination using ajax in codeigniter 4 - by coderscvoen - 06-07-2021, 12:37 AM

Theme © iAndrew 2016 - Forum software by © MyBB