Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Config class not working properly
  • Hey ma fellow FuelPHP devs, I'm trying to access the db config of my Fuel project, but against the docs calls like
    $db_configs = Config::get('db');
    
    only return NULL. It works for
    Config::get('routes');
    
    or any of the config keys set in the config.php tho. Any idea why that is? Regards,
    Ben
  • Are you loading the config in the first place?
    DB classes load the config files before accessing the config details and you should do the same for any config file you want to use. Prepend this line before and it will work: \Config::load('db', true);

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion