CodeIgniter Forums
config pagination - 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: config pagination (/showthread.php?tid=3391)



config pagination - El Forum - 09-27-2007

[eluser]easymind[/eluser]
I have made a pagination.php file in system\application\config:
Code:
<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
$config['cur_tag_open']  = '<span style="font-weight: bold; font-size: 13pt;padding: 0 0 0 2px">';
$config['cur_tag_close'] = '</span>';
$config['first_link']    = '&lt;&lt;';
$config['last_link']     = '&gt;&gt;';
?&gt;
In my controller:
Code:
$this->load->library('pagination');
$this->pagination->total_rows = count($data['news']);
$this->pagination->per_page   = '5';
$this->pagination->base_url   = site_url('/news/page');
$data['pagelinks'] = $this->pagination->create_links();

It seems that the config items are not read. Or not passed to the pagination lib. Does anyone have the same problem?


config pagination - El Forum - 09-27-2007

[eluser]cdmn[/eluser]
All config files used by libraries must be capitalized.

config/Pagination.php
config/Email.php

etc...


config pagination - El Forum - 09-27-2007

[eluser]easymind[/eluser]
Bingo, thanks.
Should have tried it, but other config files ('non libs', as you point out) were not capitalized...


config pagination - El Forum - 10-10-2007

[eluser]K-Fella[/eluser]
The user guide should be updated to reflect this. It doesn't mention anything about the need for it to be capitalised.

Quote:Setting preferences in a config file

If you prefer not to set preferences using the above method, you can instead put them into a config file. Simply create a new file called the pagination.php, add the $config array in that file. Then save the file in: config/pagination.php and it will be used automatically. You will NOT need to use the $this->pagination->initialize function if you save your preferences in a config file.



config pagination - El Forum - 12-18-2007

[eluser]kenjis[/eluser]
I think this is a bug, because all files in config directory starts with lower case.
And user guide also tells lower case.

I posted bug report:
http://codeigniter.com/bug_tracker/bug/3143/