![]() |
Problem with Custom config file - 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: Problem with Custom config file (/showthread.php?tid=37548) |
Problem with Custom config file - El Forum - 01-13-2011 [eluser]Unknown[/eluser] I'm trying to create a custom config file for active directory but I keep getting the same error no matter what I try. I read the previous topics on here about my problem, but none of the solutions seemed to help me. The error is "Your ad.php file does not appear to contain a valid configuration array." ./system/application/config/ad.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); autoload.php Code: /* swe.php Code: <?php Problem with Custom config file - El Forum - 01-13-2011 [eluser]Cristian Gilè[/eluser] A note from the userguide: Quote:If you do create your own config files use the same format as the primary one, storing your items in an array called $config The primary one is the main config.php file. $ad is not a valid array name. Cristian Gilè Problem with Custom config file - El Forum - 01-13-2011 [eluser]Unknown[/eluser] Hmm... seems your right, I was using the database.php config as a template. Thanks for your help, but just out of my sheer curiosity, why does database.php, routes.php,smileys.php etc.. get away with this and I can't? Code: $db['dev']['hostname'] = "172.29.97.7"; Problem with Custom config file - El Forum - 01-13-2011 [eluser]Cristian Gilè[/eluser] This is a convention. Cristian Gilè Problem with Custom config file - El Forum - 01-13-2011 [eluser]tomcode[/eluser] Quote:... why does database.php, routes.php,smileys.php etc.. get away with this and I can’t? The above mentioned use their own routine to load the file, the moment You load using this->load->config() You need to have a $config variable declared, here the example for the smileys : Code: /** |