Welcome Guest, Not a member yet? Register   Sign In
Pagination with Custom model
#1

Hi all,
I currently use pagination with Codeigniter Model but I cannot find how to use it with CUSTOM models.
Here is my code:

CONTROLLER
PHP Code:
<?php namespace App\Controllers;

use 
App\Models\CustomModel;

class 
Annunci extends BaseController{

  public function index() {
     
     $db 
db_connect();
     $model = new CustomModel($db);
     $annunci $model->annunci();

     return view('cet',$annunci);

  }
}

?>

And here is the MODEL

PHP Code:
public function annunci(){
  return $this->db->table('annunci')
 ->
orderBy('data''DESC')
 ->
get()
 ->
getResultArray();




I know I need to load the pager somewhere and somehow but cannot figure out how to do it. Can anyone please show me on the above code? Thanks a lot
Reply


Messages In This Thread
Pagination with Custom model - by AndreaL - 12-31-2020, 03:59 AM
RE: Pagination with Custom model - by InsiteFX - 12-31-2020, 12:27 PM
RE: Pagination with Custom model - by AndreaL - 01-04-2021, 03:03 AM
RE: Pagination with Custom model - by seunex - 01-04-2021, 04:01 AM
RE: Pagination with Custom model - by includebeer - 01-04-2021, 05:33 AM
RE: Pagination with Custom model - by AndreaL - 01-07-2021, 02:31 AM
RE: Pagination with Custom model - by rmcdahal - 01-04-2021, 06:29 AM
RE: Pagination with Custom model - by includebeer - 01-07-2021, 08:19 AM
RE: Pagination with Custom model - by AndreaL - 02-09-2021, 03:41 AM
RE: Pagination with Custom model - by MuhAnhar - 01-12-2021, 06:06 AM
RE: Pagination with Custom model - by includebeer - 01-12-2021, 03:46 PM
RE: Pagination with Custom model - by InsiteFX - 02-09-2021, 07:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB