CodeIgniter Forums
New config file - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: New config file (/showthread.php?tid=40315)



New config file - El Forum - 04-05-2011

[eluser]magiclko[/eluser]
Hi,

As said in user guide, we can create a new config file and put it in application/config folder, and after loading it we can use config variables. This is what i've done so far and IIS is giving me HTTP Error 500.0 - Internal Server Error.

application/config/config-defaults.php

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$config['databasetabletype']  =   'myISAM';

in my controller : application/controller/admin.php

Code:
$this->config->load->('config-defaults');
echo $this->config->item('databasetabletype');

Am i doing anything wrong? If i comment out

$this->config->load->('config-defaults');

last statement don't echo anything obviously but don't give any error. So, is there something which i missed while making new config file?


New config file - El Forum - 04-05-2011

[eluser]InsiteFX[/eluser]
Well! I just checked the CodeIgniter User Guide!

BUG:
Code:
// States this to load a config file!
$this->config->load('filename');

// but should be this!
$this->load->config('filename');

Try this:
Code:
$this->load->config('config-defaults', TRUE);

All the documentation for config is backwards! I would report this as a BUG in the CodeIgniter Reactor!

InsiteFX