Created
January 16, 2018 06:51
-
-
Save azazqadir/2c4ace1535054c65892bb42202f6a42d to your computer and use it in GitHub Desktop.
Creating Pagination Feature in CodeIgniter App. Learn how to create Model, Controller and View for Pagination in CodeIgniter: https://www.cloudways.com/blog/pagination-in-codeigniter/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Departments extends CI_Model | |
{ | |
public function __construct() { | |
parent::__construct(); | |
} | |
public function record_count() { | |
return $this->db->count_all("Departments"); | |
} | |
public function fetch_departments($limit, $start) { | |
$this->db->limit($limit, $start); | |
$query = $this->db->get("Departments"); | |
if ($query->num_rows() > 0) { | |
foreach ($query->result() as $row) { | |
$data[] = $row; | |
} | |
return $data; | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment