Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Module config load
sagikazarmark
November 2012
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;
}
}
Harro
November 2012
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.
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
November 2012