Welcome Guest, Not a member yet? Register   Sign In
New config file
#1

[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?
#2

[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




Theme © iAndrew 2016 - Forum software by © MyBB