CodeIgniter Forums
autoload config with "second parameter" - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: autoload config with "second parameter" (/showthread.php?tid=61362)



autoload config with "second parameter" - djsuperfive - 04-10-2015

Hi,
is it possible to autoload a config file with a second parameter set to TRUE, like it is possible in the manual way :

$this->config->load('blog_settings', TRUE);
see http://www.codeigniter.com/userguide3/libraries/config.html#manual-loading

thanks !


RE: autoload config with "second parameter" - ciadmin - 04-10-2015

Reading the user guide, you can
$this->config->load('blog_settings', TRUE);

and you would then reference those config items using
$site_name = $this->config->item('site_name', 'blog_settings');


RE: autoload config with "second parameter" - djsuperfive - 04-10-2015

(04-10-2015, 02:24 PM)ciadmin Wrote: Reading the user guide, you can
$this->config->load('blog_settings', TRUE);

and you would then reference those config items using
$site_name = $this->config->item('site_name', 'blog_settings');

thanks, but I'm talking about adding the config file in the autoload.php file.

$autoload['config'] = array( '' );
I would like to write :

$autoload['config'] = array( array('blog_settings', TRUE) );

but that doesn't work.

Could be a good feature ?