Welcome Guest, Not a member yet? Register   Sign In
Extra Pagination Page Number
#1

[eluser]Unknown[/eluser]
Hi ,
When I'm using pagination with $config['use_page_numbers'] = TRUE; and ci makes pagination links, it put 1 extra page number!!
for example i have 38 rows!and per_page is 10, ci makes 1 2 3 4 5 (the Five is Extra!)

this is my code:
Code:
$msg = $this->session->flashdata('msg');
  $this->load->model('admin_panel','ap');
  $this->ap->alterTable('pm','id','DESC');
  $this->load->library('pagination');
  $config['base_url'] = base_url() . 'admin/mng_posts/';
  $config['total_rows'] = $this->db->get_where('content',array('static' => '0'))->num_rows();
  $config['num_links'] = 5;
  $config['per_page'] = 10;
  $config['uri_segment'] = 3;
  $config['full_tag_open'] = '<div id="pagintion">';
  $config['full_tag_close'] = '</div>';
  $config['use_page_numbers'] = TRUE;
  $page_number = $this->uri->segment(3);
  $offset = $config['per_page'] * $page_number;
  $posts = $this->ap->pagenated('content', array('static' => '0'),$config['per_page'], $offset);;
  $this->pagination->initialize($config);
  $data = array('posts' => $posts, 'msg' => $msg);
  $this->load->view('admin/mng_posts',$data);


Messages In This Thread
Extra Pagination Page Number - by El Forum - 08-24-2012, 12:16 AM
Extra Pagination Page Number - by El Forum - 08-24-2012, 02:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB