Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->load->library('pagination');
- $this->load->model('model');
- $this->config->load('pagination');
- $def_config = $this->config->item('pagination');
- $pagination_uri_segment = $this->uri->rsegment(3);
- $config = array_merge($def_config , [
- 'base_url' => base_url($this->router->class . '/' . $this->router->method),
- 'total_rows' => $this->model->count_all(),
- 'uri_segment' => $pagination_uri_segment,
- 'per_page' => 20,
- ]);
- $this->pagination->initialize($config);
- $this->load->view('view',[
- 'pagination_links'=> $this->pagination->create_links(),
- 'records'=> $this->model->find_all([
- 'limit'=> $config['per_page'],
- 'offest'=> $config['uri_segment'],
- ]),
- ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement