Welcome Guest, Not a member yet? Register   Sign In
Loading items from database for custom config file?
#1

[eluser]Skoobi[/eluser]
Hi I've created a config file for my site items like the site name site email and so on but i want to try and store them in the database and have the config file load them from there.

At the moment i have my config file my_config.php :

Code:
$config['site_name']  = 'My CMS';
$config['site_email']  = '';
$config['display_members'] = true;
$config['display_registration'] = true;

but what i want to do is pull it from the database so it comes as an array.

Code:
$config['site_name']  = $settings['site_name'];
$config['site_email']  = $settings['site_email'];
$config['display_members'] = $settings['login_link'];
$config['display_registration'] = $settings['register_link'];


Is there a way i can do this like i do in the controllers???

Cheers
Chris


Messages In This Thread
Loading items from database for custom config file? - by El Forum - 09-12-2014, 11:07 PM
Loading items from database for custom config file? - by El Forum - 09-13-2014, 06:04 AM
Loading items from database for custom config file? - by El Forum - 09-13-2014, 06:28 AM
Loading items from database for custom config file? - by El Forum - 09-13-2014, 03:47 PM
Loading items from database for custom config file? - by El Forum - 09-14-2014, 06:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB