Created
October 19, 2016 11:07
-
-
Save Tjoosten/cea3c27a85f9e464284dc56a1d4b6758 to your computer and use it in GitHub Desktop.
This file contains 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 | |
// Model | |
/** | |
* Get all the users. | |
* | |
* @return array | |
*/ | |
public function fetch_users($offset = 0) | |
{ | |
return $this->db->get($this->table, 10, $offset); | |
} | |
// Controller | |
/** | |
* The user management index. | |
* | |
* @return view | |
*/ | |
public function index() | |
{ | |
// Data variables. | |
$data['title'] = 'User management index'; | |
$data['users'] = $this->user->fetch_users(); | |
$config['base_url'] = base_url() . '/user/'; | |
$config['total_rows'] = 20; | |
$config['per_page'] = 10; | |
$this->pagination->initialize($config); | |
// View rendering. | |
$this->load->view('template/header', $data); | |
$this->load->view('template/navbar', $data); | |
$this->load->view('front-end/users'); | |
$this->load->view('template/footer'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment