CodeIgniter Forums
Custom Configuration File For Application - 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: Custom Configuration File For Application (/showthread.php?tid=15223)

Pages: 1 2


Custom Configuration File For Application - El Forum - 04-30-2010

[eluser]InsiteFX[/eluser]
What is it that you need to do?

InsiteFX


Custom Configuration File For Application - El Forum - 04-30-2010

[eluser]carvingCode[/eluser]
I was hoping to reduce the 7 pagination config statements to one. I'm using the settings in multiple methods.


Custom Configuration File For Application - El Forum - 04-30-2010

[eluser]cahva[/eluser]
So whats the problem? BTW, you can use the shorter version of getting config item:
Code:
config_item('first_tag_open');
That helper function is always available.

Maybe we can give some advice if we can see code how you are using those config items now..


Custom Configuration File For Application - El Forum - 04-30-2010

[eluser]carvingCode[/eluser]
The statements for part of the settings of the Pagination library. Instead of including them, as listed below, I thought I could place them in a app config file and just call an array. Is this where a 'hook' may come in handy?

Code:
$config['first_tag_open'] = ' | ';
$config['first_tag_close'] = ' |';
$config['last_tag_open'] = '| ';
$config['last_tag_close'] = '| ';
$config['num_tag_open'] = ' | ';
$config['next_tag_open'] = ' | ';
$config['next_tag_close'] = ' ';



Custom Configuration File For Application - El Forum - 04-30-2010

[eluser]danmontgomery[/eluser]
http://ellislab.com/codeigniter/user-guide/libraries/pagination.html

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 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.



Custom Configuration File For Application - El Forum - 04-30-2010

[eluser]carvingCode[/eluser]
Zowie! I was all over that page in the docs earlier in the week. Missed this. Thanks!

Edit: All is working great.