I read all the questions about Stackoverflow and did not find a definitive answer to the question. I am currently using the code break library to create page links using limit and offset:
$config['base_url'] = base_url() . 'explore/featured/index/';
$config['total_rows'] = $this->Projects_model->get_featured_count();
$config['per_page'] = 12;
$config['uri_segment'] = 4;
$config['display_pages'] = FALSE;
$config['next_link'] = 'Older →';
$config['prev_link'] = '← Newer';
$this->pagination->initialize($config);
$limit = $config['per_page'];
$offset = $this->uri->segment(4);
$data['pagination'] = $this->pagination->create_links();
$data['projects'] = $this->Projects_model->get_featured($limit, $offset);
The above code limits the output of my request and uses the offset contained in my fourth segment of the URI.
How can I change the code below to page numbers ??? It seems impossible, because I can no longer use the offset in my URL.
source
share