It will highlight the first item all the time.Pagination is working.But selected page is not diplayed correctly.
Add this line to Pagination.php file which is located at system->libraries->Pagination.php
$this->uri_segment = $CI->uri->total_segments();
Add this line to where I have shown below.
// Determine the current page number.
$CI =& get_instance();
if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE) {
if ($CI->input->get($this->query_string_segment) != 0) {
$this->cur_page = $CI->input->get($this->query_string_segment);
// Prep the current page - no funny business!
$this->cur_page = (int) $this->cur_page;
}
}
else {
$this->uri_segment = $CI->uri->total_segments();
if ($CI->uri->segment($this->uri_segment) != 0) {
$this->cur_page = $CI->uri->segment($this->uri_segment);
// Prep the current page - no funny business!
$this->cur_page = (int) $this->cur_page;
}
}
1 Comments
thank you for this, my uri was actually only 2 segments and current page was not working, this solved it!! cheers buddy
ReplyDeletePost a Comment