Loading an advanced module's model from another advanced module's controller
How to do it properly?
I need to show rows taken from various module's models ... say from the blog module, my own 'twitter' module etc
but if i do
$this->load->module_model('twitter', 'tweets_model');
I get this
An Error Was Encountered
The configuration file development/twitter.php and twitter.php do not exist.
Comments
the twitter model extends Base_module_model
Inside my twitter model i'm loading the config
$this->config->load('twitter');
but apparently this is not needed at all... but why?
How do i load the twitter.php config file inside modules/twitter/config then?
But why? It would make total sense that the model loads the config file autonomously ... or am i doing something wrong??
What the hell i'm pulling my hair on this!!!
This is the controller OUTSIDE of the 'twitter' module (part of another advanced module) This one gives that damn error!!!
But if i do the same thing from the 'twitter' controller inside the twitter module, all goes fine...
So,
In the end I moved the $this->config->load calls to the controllers that need to load the model. But I found out that if you want to load the configuration file of a model outside of the current module, you have to add the 4th param to the config->load function like this which is the 'module' parameter.
Hope this helps someone...