CodeIgniter Forums

Full Version: Pagination Links
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]cybersven[/eluser]
Hi,

I'm using Pagination Class everything is working correctly.

My actual URLs are like :
Code:
http://mysite.com/index.php/home/index/0
http://mysite.com/index.php/home/index/4
http://mysite.com/index.php/home/index/8
...
So 4 results per page.

Now I've added a category in the url like :
Code:
http://mysite.com/index.php/home/index/0/A
and it works

but I want that the pagination class give me next links like :
Code:
http://mysite.com/index.php/home/index/4/A
http://mysite.com/index.php/home/index/8/A
http://mysite.com/index.php/home/index/12/A
...
and actually next page give me this link :
http://mysite.com/index.php/home/index/4

How can I add this segment in the links ?

Thx in advance

El Forum

[eluser]cybersven[/eluser]
I've found the solution in the Library :-D

Code:
$config['suffix']

So here is my solution :

Code:
$cat = ($this->uri->segment(4)) ? $this->uri->segment(4) : 0;
$config['suffix'] = '/'.$cat;