Pagination Config (Autoload) - 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 Config (Autoload) (/showthread.php?tid=40686) |
Pagination Config (Autoload) - El Forum - 04-15-2011 [eluser]Kunzilla[/eluser] Hi, i tried to autoload the pagination libary with an extra config file (/application/config/pagination.php), but it didnt work for me. Code: $autoload['libraries'] = array('database', 'session', 'email', 'form_validation', 'encrypt', 'pagination'); Code: $autoload['config'] = array( 'pagination' ); /application/config/pagination.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); The controller "user" looks: Code: class User extends CI_Controller { In the view i use this code: Code: <?=$this->pagination->create_links()?> I want to put that stuff into a config file for global use. But i cant set the "base_url" without overwriting the $config['base_url] in the /config.php. Can anyone help me? Thanks Pagination Config (Autoload) - El Forum - 04-15-2011 [eluser]InsiteFX[/eluser] You should not be autoloding the pagination config file, the pagination class will autoload it from application/config ! InsiteFX Pagination Config (Autoload) - El Forum - 04-15-2011 [eluser]Kunzilla[/eluser] Ok, but how can i Set the Default values globaly? Pagination Config (Autoload) - El Forum - 04-15-2011 [eluser]InsiteFX[/eluser] What are you trying to make global? Any time you load the pagination class were you need it it will load your pagination configuration file! InsiteFX Pagination Config (Autoload) - El Forum - 04-15-2011 [eluser]Kunzilla[/eluser] Yes, that is what i Want. But i couldnt Set base_url for example. It will overwrite the application base URL. Pagination Config (Autoload) - El Forum - 04-15-2011 [eluser]InsiteFX[/eluser] It will not over write your base_url because you are not using a set command on the config! This is the only way it will change your base_url! Code: $this->config->set_item('item_name', 'item_value'); InsiteFX |