Skip to content

Instantly share code, notes, and snippets.

@Tjoosten
Created October 19, 2016 11:07
Show Gist options
  • Save Tjoosten/cea3c27a85f9e464284dc56a1d4b6758 to your computer and use it in GitHub Desktop.
Save Tjoosten/cea3c27a85f9e464284dc56a1d4b6758 to your computer and use it in GitHub Desktop.
<?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