Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Module config load
  • I am trying to load a config file in my module, but it returns an empty array.

    The code:

    namespace Mymodule;

    class Myclass {

    public static function _init() {
    \Config::load('myconfig');
    $config = \Config::get('myconfig.config1');
    var_dump($config); // returns NULL
    exit;

    }

    }
  • HarroHarro
    Accepted Answer
    Possible causes:

    The modules/mymodule/config/myconfig.php does not exist, is unreadable, or empty. You can test this by dumping the return value of Config::load().

    If it exists, does it contain

    return array(
        'config1' => 'something'
    );

    if not, it returns null.

Howdy, Stranger!

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

In this Discussion