Paging not properly working Codeigniter -
my pagination not working have problems
here controller
$this->load->library('pagination'); $query= $this->db->get('invoice','5', $this->uri->segment(3)); $data['invoices']=$query->result(); //enter code here $query2=$this->db->get('invoice'); $config['base_url'] = '/dashboard/billing'; $config['total_rows'] =$query2->num_rows(); $config['per_page'] = 5; $config ['full_tag_open'] = '<ul class="pagination">'; $config ['full_tag_close']='</ul>'; $config ['first_tag_open'] = '<li class="page-item page-link ">'; $config ['last_tag_open']='<li class="page-item page-link">'; $config ['next_tag_open'] = '<li class="page-item page-link ">'; $config ['perv_tag_open']='<li>'; $config ['num_tag_open'] = '<li class="page-item page-link">'; $config ['num_tag_close']='</li>'; $config ['first_tag_close'] = '</li>'; $config ['last_tag_close']='</li>'; $config ['next_tag_close'] = '</li>'; $config ['perv_tag_close']='</li>'; $config ['cur_tag_open'] = '<li class="page-item active page-link ">'; $config ['cur_tag_close']='</li>'; $this->pagination->initialize($config); $this->pagination->create_links(); $this->load->view('dash_billing',$data);
and transferred $data view , run foreach loop getting error
1)not able click page 1 (actually opened in 2nd page)
3)next button work once
4)when click last button can see other link not working
i solved line of code
$config['use_page_numbers'] = true;
Comments
Post a Comment