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