Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
On HMVC
  • Is it possible to call for module's controller/model functions from withing other module without utilization of Request::factory('blah blah')->execute(); method? For example, right now i can use this function from within of module's model:
        $data = \Controller_Test::hello();
    

    It'll call for test.php file located in app/classes. But let's say i want to call same controller, but this time it's located in it's own module Test.
    Ideally, it'd look like that:
    \Test\Controller_Test::hello();
    

    Right now i'll just get an error saying that "Class Controller_Test not found." Any thoughts?
  • Modules need to be loaded to become available. When they're called from the URL they're loaded automaticly, if you want to use them in other cases you have to load them first:
    Fuel::add_module('test');
    

    You can also add them to the "always_load" array under "modules" in the app/config/config.php file if you need a module to be always available.
  • Thanks a lot, jschreuder. That thing deserves to be in docs.

Howdy, Stranger!

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

In this Discussion