Welcome Guest, Not a member yet? Register   Sign In
[ERROR] Pagination initialize() in Codeigniter 2.10
#5

[eluser]Stefan Hueg[/eluser]
Could you change the following lines:

bukutamu_model.php

Code:
function select_limit($limit = array())
  {
   if(empty($limit))
   {
    return $this->db->count_all('tbl_bukutamu');
   }
   else
   {
    return $this->db->limit($limit['per_page'], $limit['offset'])->get('tbl_bukutamu')->num_rows();
   }
  }

action.php
Code:
function view()
{
  $data['title'] = 'Buku Tamu';
  
  // tentukan jumlah data per halaman
  $perpage = 3;
  $this->load->library('pagination');

  // Konfigurasi Pagination
  $config['base_url'] = base_url().'bukutamu/action/view/';
  $config['total_rows'] = $this->bukutamu_model->select_limit();
  $config['per_page'] = $perpage;
  
  $this->pagination->initialize($config);
  $data['bukutamu_list'] = $this->bukutamu_model->select_limit(array('per_page'=>$perpage, 'offset'=>$offset));

  $this->load->view('bukutamu/list_bukutamu_view', $data);
}

and try it again?

If this even does not work, could you upload your whole project?


Messages In This Thread
[ERROR] Pagination initialize() in Codeigniter 2.10 - by El Forum - 04-30-2012, 02:06 AM
[ERROR] Pagination initialize() in Codeigniter 2.10 - by El Forum - 04-30-2012, 03:28 AM
[ERROR] Pagination initialize() in Codeigniter 2.10 - by El Forum - 04-30-2012, 08:11 AM
[ERROR] Pagination initialize() in Codeigniter 2.10 - by El Forum - 05-01-2012, 09:46 AM
[ERROR] Pagination initialize() in Codeigniter 2.10 - by El Forum - 05-01-2012, 11:36 AM
[ERROR] Pagination initialize() in Codeigniter 2.10 - by El Forum - 05-01-2012, 12:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB