CodeIgniter Forums
Pagination class issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Pagination class issue (/showthread.php?tid=44453)



Pagination class issue - El Forum - 08-15-2011

[eluser]Christophe28[/eluser]
Hello,

For some strange, but probably obvious reason the pagination doesn't work in my application.

This is the code I use in the controller:
Code:
$this->load->library('pagination');

$config['base_url'] = 'http://www.myurl.com/photos/';
$config['total_rows'] = '640';
$config['per_page'] = '64';

$this->pagination->initialize($config);

This is the code I use in the view:
Code:
<?php echo $this->pagination->create_links(); ?>

When I surf to http://www.myurl.com/photos/ the pagination numbers are visible on the page, but then, when I click on of the numbers, the URL changes to http://www.myurl.com/photos/64/ and I get a 404 ...

Doesn't anybody know what I do wrong :-(

Thx!


Pagination class issue - El Forum - 08-15-2011

[eluser]OliverHR[/eluser]
Check this setting:

Code:
$config['uri_segment']



Pagination class issue - El Forum - 08-15-2011

[eluser]Christophe28[/eluser]
This gives the same result.

Any other suggestions?


Pagination class issue - El Forum - 08-15-2011

[eluser]OliverHR[/eluser]
Are you using .httaccess file?


Pagination class issue - El Forum - 08-15-2011

[eluser]Christophe28[/eluser]
I use nginx ...


Pagination class issue - El Forum - 08-15-2011

[eluser]OliverHR[/eluser]
Mmm. to sounds like a Rewrite rule issue, but I never had to work with NGinx.


Pagination class issue - El Forum - 08-15-2011

[eluser]Christophe28[/eluser]
Apparently you have to set the routes to use the pagination the way I use it.

I had to paste this in the routes.php file: $route['photos/(:num)'] = 'photos';