Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class page extends CI_Controller {
- protected $href = '';
- //put your code here
- public function __construct()
- {
- parent::__construct();
- $this->load->library(array('pagination','links'));
- $this->href = array(
- 'form' => $this->links->get_link().'/form',
- 'refresh' => $this->links->get_link(),
- 'batal' => $this->links->get_link(),
- );
- }
- public function halaman() {
- $this->index();
- }
- public function index() {
- $this->load->model('pagination/data');
- $hal = number_format((float)$this->uri->segment(3));
- $per_page = 5;
- $pcfg = array(
- 'base_url' => $this->links->get_link() . '/page/halaman/',
- 'per_page' => $per_page,
- 'total_rows' => $this->data->all_data(),
- 'attributes' => array('class' => 'btn btn-default'),
- 'full_tag_open' => '<div class="btn-group">',
- 'full_tag_close' => '</div>',
- 'cur_tag_open' => '<button type="button" class="btn btn-danger">',
- 'cur_tag_close' => '</button>',
- 'first_link' => 'Awal',
- 'last_link' => 'Akhir',
- );
- $this->pagination->initialize($pcfg);
- $res = array(
- 'list' => $this->data->data_pengguna($per_page,$hal),
- 'jmldata' => $pcfg['total_rows'],
- 'link' => $this->pagination->create_links(),
- );
- $this->load->view('pagination/view_page',$res);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement