CodeIgniter: invoking multiple controllers in one call

canadianpanda

New Member
I am solving a kind of architectural problem inside CI.I need to be able to instantiate other controllers and their methods in main controller.E.g.\[code\]*main.php/function index():*$controller2 = new Controller2();$data['pre_loaded_data'] = $controller2 ->ajax_get_some_view(array('static'=>true));\[/code\]The goal behind this approach is to build ajax application which loads some screen partsstatically at first load, as part of main html page, but later these parts are updated with ajax methods to from various other controllers(at this time with array('static'=>false) param), e.g as reponse to onclick event on main page.The problem is that CI doens't seem to be design to support multiple controllers and throws various loader-related errors reporting that some class is not loaded even when it's loaded.What would be the best approach to pre-load data from other controllers in the main controller?
 
Back
Top