wiredesignz - 29 October 2008 11:48 PM
@dcunited08,
Can you explain what you mean by callback, also what is ‘Module’/‘Folder’? and which ME class do you need to extend?
ME supports submodules, I.E. APPPATH/modules/mod_name/sub_mod_name. The views and models and such load fine, the controllers do not. That is the ‘Module’/‘Folder’.
The callback I am talking about is in find where all the possible paths are selected. It would be nice to allow a user-defined function to add to that list. In my app, I have a mod_name/views/folder/view_name which currently is not supported. That is fine that it is not supported, I would like to be able to add it to the places to search by defining a function that adds it.
The class I was attempting to extend was the Loader class, the reason is that the load property does not appear to be copied properly to models because the get_instance function returns the called_controller, not the loaded_module. The end result is loaded_model->load is the instance created by the called_controller so when libraries are loaded they are copied to the other models (if any), not the loaded_model.
definitions:
called_controller = controller called by CI,
loaded_module = controller loaded by load->module(),
loaded_model = model loaded by the loaded_module.
in MY_Modules
static function get_calling_instance($_caller = null)
{
if($_caller === null)
{
return get_instance();
}else{
return self::$registry[$_caller];
}
}
This is then called in the MY_Model:_assign_libraries function and the $_caller is set by a parameter in the constructor. If there is a better way to do this, I would be great appreciative if you would point it out. The only other way I could think to do this is by doing a backtrace to see what the calling object was.
Overall, I had it working in the old version because you used the Controller as the load class but I am glad you moved that functionality to a separate Load class.