Welcome Guest, Not a member yet? Register   Sign In
Pagination - problem inserting offset into URI
#1

[eluser]Unknown[/eluser]
Hi!

Got a weird problem with pagination, looked through the forums but haven't found anyone else with same prob.

Have a page which presents information depending on filters. Storing the filters in the URI. One of those is the pagination offset (the 3rd segment).
e.g. localhost/index.php/controller/function/ALL/YES/25/NO/NONE

Problem is that pagination always appends the offset to the end of the URI!

I've tried setting $config['base_url'] to the whole url including the filters, as well as the basic url without the filters (just up to the function).

Tried lots of settings for $config['uri_segment'] but it never makes any difference. Always appends.

Any ideas? Suspect I'm doing something dumb if no-one else has experienced it. Need code?

Thanks for reading!
Keith
#2

[eluser]xwero[/eluser]
the uri_segment config setting is only to check the url for the place in the links.
Code:
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;
        }
The baseurl is used to append the link number to
Code:
$this->base_url.$i

So i guess you have to rearrange your segments if you want to use the pagination library.
#3

[eluser]Unknown[/eluser]
Thanks very much!

Got it all working beautifully thanks to you.

Much appreciated.




Theme © iAndrew 2016 - Forum software by © MyBB