SemicolonAcademy / ci-cms

Automatically exported from code.google.com/p/ci-cms
Other
0 stars 0 forks source link

Pagination links not working correctly within ci-cms #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

The PROBLEM
=============
In the controller, I am using code similar to the following to create
pagination links:

//begin
$this->load->library('pagination');

$config['base_url'] = 'http://www.your-site.com/index.php/test/page/';
$config['total_rows'] = '200';
$config['per_page'] = '20';

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

echo $this->pagination->create_links();

//end

The pagination links are created correctly in the view.
When one clicks on the pagination links, the correct
results are displayed depending on the page number clicked.

However, instead of the page number of the page you clicked
being highlighted,the first page or page one is still highlighted
though the results are for the correct page clicked.
Please see below.

<b>1</b> 2 3 Last

Any assistance would be appreciated.
Thanks in advance.

Original issue reported on code.google.com by pmw...@gmail.com on 12 May 2009 at 3:16

GoogleCodeExporter commented 9 years ago
if you are using this
'http://www.your-site.com/index.php/test/page/';

then you should have

$config['uri_segment'] = 3;
$config['base_url'] = base_url() . 'test/page';
$config['total_rows'] = '200';
$config['per_page'] = '20'; 

The $config['uri_segment'] is very important because we use another uri pattern

Original comment by heriniai...@gmail.com on 12 May 2009 at 3:26

GoogleCodeExporter commented 9 years ago
Thank you very much, it worked.
Thanks alot!

Original comment by pmw...@gmail.com on 12 May 2009 at 3:42

GoogleCodeExporter commented 9 years ago

Original comment by heriniai...@gmail.com on 23 Jun 2009 at 10:03