\Config::load('moduleconfig', true);it doesn't find the file that's inside the module config folder. I don't know if I have to add some path somewhere or is it meant to work out-of-the-box; so I would appreciate if someone would shed some light into this. I've been working with FUEL for a couple of weeks now and so far I'm loving it! So much more flexible than CI (which I used to develop before); but sadly I must say that it is lacking of documentation. I understand that this project is just 'starting' and the efforts are put into the code so we'll have to be patient but I would love to see some improvements in the documentation explaining just how some things work inside FUEL, because as of now sometimes we have to struggle to understand how it works. Great work!
Config::load('Module\\config.php'); // where "Module" == the module namespace
- app |- modules |- puas |- classes |- manager.php |- config |- config.php |- views
<?php namespace PuAs; return array( 'test' => 'success' ); /* End of file config.php */
var_dump(\Config::load('PuAs\\config.php'));following the instructions you gave me; but all I get in return is an empty array. I then tried to load it from the manager.php file but had the same result. Am I missing something? I was looking inside the load() function from the \Config class and it seems like it only searches files inside the global config folder, but does not look into module config folders. By the way: I do add the module using
\Fuel::add_module('puas');on both examples.
array(1) { ["test"]=> string(4) "success" }
- mod1 |- config |- config.php -mod2 |- config |- config.php
$mod1_config = \Config::load('mod1\\config', true); $mod2_config = \Config::load('mod2\\config', true);
$path = $directory.DS.strtolower($file).$ext; var_dump($path);will output in both cases:
string(17) "config\config.php"
if (static::$path_cache !== null and array_key_exists($cache_id.$path, static::$path_cache)) { return static::$path_cache[$cache_id.$path]; }
string(49) "d41d8cd98f00b204e9800998ecf8427econfig\config.php"which is wrong because they are two different paths!!! I think the namespace should be somewhere involved in assigning a key for the cached path.
It looks like you're new here. If you want to get involved, click one of these buttons!