------------------------------------------------------
Main code:
------------------------------------------------------

 public function forum_detail_info($post_id) {
        $data = array();
          $this->load->library('pagination');
        $config['base_url'] = base_url() . 'welcome/forum_detail_info/';

        $config['total_rows'] = $this->db->count_all('tbl_forum');
        $config['per_page'] = 3;
        $this->pagination->initialize($config);
        $data['about'] = $this->welcome_model->about_info();
        $data['about'] = $this->welcome_model->about_info();
        $data['forum_post_info'] = $this->welcome_model->select_all_forum_post_info($post_id);
        //---------------more
        $this->load->view('website/include/header', $data);
        $this->load->view('website/master_page', $data);
        $this->load->view('website/include/footer');
    }


----------------------------------------------
  I want code:
----------------------------------------------


   public function forum_detail_info($post_id) {
        $data = array();
          $this->load->library('pagination');
        $config['base_url'] = base_url() . 'welcome/forum_detail_info/';

        $config['total_rows'] = $this->db->count_all('tbl_forum');
        $config['per_page'] = 3;
        $this->pagination->initialize($config);
        $data['about'] = $this->welcome_model->about_info();
        $data['forum_post_info'] = $this->welcome_model->select_all_forum_post_info($post_id);
       $data['forum_post_info'] = $this->welcome_model->select_all_forum_post_info($config['per_page'], $this->uri->segment(3),$post_id);
         //--------------more
        $this->load->view('website/include/header', $data);
        $this->load->view('website/master_page', $data);
        $this->load->view('website/include/footer');
    }

I can create pagination for those function (1) that has no parameter,But i can not do for those function that has parameter (2)like--

(1)

public function forum_detail_info() {
------
}

(2)

public function forum_detail_info($post_id) {
----}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.