Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Config::get('db') is null?
  • Hey Guys, According to the documentation of Config, we should be able to get the whole db config via
    Config::get('db')
    

    as per the docs on http://docs.fuelphp.com/classes/config.html we need this to switch the active db config, which is documented but as mentioned we just keep getting null, in a controller we have:
    $db_configs = Config::get('db');
    Debug::dump($db_configs);
    

    This returns NULL
  • O please make it more like DataMapper!!!
  • The current FuelPHP ORM already supports method chaining, which is quite similar to how DataMapper works.
  • You need to load the config before you can get it. The Database classes do this when first used, but if you get it before the first database call, you get null returned. Use "\Config::load('db', true);" to load it manually.
  • Thanks again, worked a treat! loving the quick responses, converting from Codeigniter's DataMapper to Fuel's ORM is interesting, we do miss some stuff from DataMapper :P
  • Who knows, you might see a FuelPHP version of DataMapper pop up next year... But it could also be that v2 of DataMapper for CI is going to look a lot more like FuelPHP's ORM... ;)

Howdy, Stranger!

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

In this Discussion