pagination in codeigniter with example

Solutions on MaxInterview for pagination in codeigniter with example by the best coders in the world

showing results for - "pagination in codeigniter with example"
Giulia
02 Sep 2018
1// Controller End
2$config = array();
3$config["base_url"] = base_url() . "index.php/StudentPagination_Controller/index";
4$config["total_rows"] = $this->StudentPagination_Model->get_count();
5$config["per_page"] = 10;
6$config["uri_segment"] = 3;
7
8$this->pagination->initialize($config);
9
10
11$page = ($this->uri->segment(3))? $this->uri->segment(3) : 0;
12
13$data["links"] = $this->pagination->create_links();
14
15$data['student'] = $this->StudentPagination_Model->get_students($config["per_page"], $page);
16
17$this->load->view('pagination', $data);