I have read all questions on Stackoverflow and have seen no definitive answer to the question. I am currently using the codeigniter pagination library to generate my pagination links using a limit and an offset:
$config['base_url'] = base_url() . 'explore/featured/index/';
$config['total_rows'] = $this->Projects_model->get_featured_count();//Count featured projects
$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); //get featured projects from database
The above code limits the output values of my query and uses an offset that is contained in my 4th URI segment.
How can I change the below code to page numbers??? Appears to be impossible because i would be no longer able to use an offset in my url.