Hi, is there a way to autoload a module once I call it?
I have a Model_User (orm) relationships, and it seems that it throws me an error because the relationships models come from other modules and as I didn't load them previously it throws me an error of course ... so, what I should do?
You can not call anything in the module until the autoloader knows the modules' namespace, and knows where it is on disk. So you need to use either Module::load() first, or define the module in the always_load section of your config.
Having said that, creating tight dependencies between modules is a bad idea, the idea behind modules is that they are optional, and can be replaced or removed. If you need "helper" style stuff, you better create packages for it.
The thing is that I'm working alone on a project, and since I discovered the modules of FuelPHP everything is a lot easier to me, easier to debug, to test, the config files views and everything in the same folder, and so on.
So for example I have a module named "users" and another one named "articles", and as they have relationships in the database I have to call from users with $has_many the articles model.
What would you suggest me my friend? I wouldn't believe that I'm the only one that does it this way, or am I?
In general, if your "seperated code" contains frontend code, i.e. a controller, create a module. If it doesn't, create a package.
However, both need to be loaded before they can be used, which you can do in the always_load section of your app config.
Packages have the added benefit of a bootstrap, so you can use that to have one package load others, to define the classes in the package to speed up the autoloader, etc.
Modules are URI routeable, so be careful if they contain controllers, since they can be called from the client.
I'd say if depedencies are not a problem for you, just define them in your always_load section of the config.