Wednesday, April 8, 2015

Pagination Issue in Codeigniter [solved]

There is many students face problem in Pagination library in CI

Please update the following code and your problem resolved

public function index($index=1)
        $per_page=2;   // set accorrding to requiremnet
            $query = $this->db->get($table_name);
   // pagination     

            $config['base_url'] = base_url().'admin/controller_function/index/';
            $config['total_rows'] = $num_rows_pagination;
            $config['per_page'] = $per_page;
             $config['uri_segment'] = 4;
               // pagination formating
                    $config['full_tag_open'] = "<br><ul class='pagination'>";
                    $config['full_tag_close'] ="</ul>";
                    $config['num_tag_open'] = '<li>';
                    $config['num_tag_close'] = '</li>';
                    $config['cur_tag_open'] = "<li class='disabled'><li class='active'><a href='#'>";
                    $config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";
                    $config['next_tag_open'] = "<li>";
                    $config['next_tagl_close'] = "</li>";
                    $config['prev_tag_open'] = "<li>";
                    $config['prev_tagl_close'] = "</li>";
                    $config['first_tag_open'] = "<li>";
                    $config['first_tagl_close'] = "</li>";
                    $config['last_tag_open'] = "<li>";
                    $config['last_tagl_close'] = "</li>";
            $user_data['pagination']= $this->pagination->create_links();
            $user_data['page'] = 'controller_function';
        $this->load->view('admin/Manage/view_page',$user_data);   // Customize according its to view panel
//================= YOUR MODEL and Controller According to your Project ================ 


  1. My friend Suggest me this blog and I can say this is the best blog to get the basic knowledge.Thank you so much for this Selenium Training in Chennai

  2. Well explained. Got to learn new things from your Blog on Coded UI.Coded UI Training in Chennai

  3. SAP MM,SD, real Time Training in Chennai
    We provides Best SAP MM,SD Training in Chennai wih real time project assistance by our leading Materail Management Consultant.
    For Free Live Demo @ Call to 8122241286.
    SAP MM
    SAP SD


Related Posts Plugin for WordPress, Blogger...