Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Module config.php
  • Hi,

    I would like to autoload some lang files inside my module. I tried to create a config.php file from the app/config folder in the module/config folder, but my lang files would not load, and I am not sure it can be done this way.
  • I think this way is wrong. You can use language file load process at your module's controller before() method. If you use autoload language file by module name (eg: blog.php(lang) file for blog module), you can use at base controller's before() method.
    [eg usage] :
    $active = $this->request->active();
    $module = $active->module;
    Lang::load($module.'::'.$module);

  • HarroHarro
    Accepted Answer
    There is no relation between config files and lang files, so I'm not sure I follow you.

    What exactly do you want to do? You want to 'always_load' a language file from a module?

    That is not officially supported (a module should be self-contained), but you can try to use "modulename::langfile", which will only work if the module has been loaded first, so make sure the module is also defined in the 'always_load' module section.
  • Yes, actually I want to load specific lang files ALWAYS, but only in the MODULE.

    I could load them from the controller, and then extend this controller, but I use rest and template controllers inside the module.

    Is it possible to create a boostrap file inside a module?
  • Have you tried what I suggested?
  • Yes, I am doing that way now, thanks.

Howdy, Stranger!

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

In this Discussion