3
votes

I've noticed the following behavior in CI's pagination class:

My initial page (used as $config['base_url']):

http://www.example.com/forum

When I paginate to page 2 (per_page = 10, offset = 10, total_rows = 100):

http://www.example.com/forum/10

When I go back to Page 1:

http://www.example.com/forum/  <=====trailing slash

This trailing slash is messing up several Ajax commands in the page.

Any idea how to make it go away?

1
When you're on /10 or /20, aren't the AJAX commands messed up as well? The best solution is to fix your AJAX urls.minboost
use $this->uri->segment(1) in your ajax urls (possible slash removing needed, did not test it)user973254

1 Answers

1
votes

You can use trim for that:

trim( $the_url, '/' );