Maybe methods could be added to function like that too?
Well, the actual methods of HMVC class relies on CI Loader and you can’t specify a different directory where CI will load the models or views. I think to do this is not possible without extending the core as Matchbox do. But such thing is something that Wiredesignz want to avoid completely.
You are not 100% right because you only need to change the APPPATH and BASEPATH constants and you are free to put anything anywhere you want. I’ve added MY_Loader to the wiki which gives you the possibility to change those two constants. In the render method now you can do (taken from an example in the thread)
function render() //build the searchbox view partial
{
$price_opts = array(
'All price ranges',
'New arrivals - POA',
'Cars under $5000',
'Cars $5000 and over',
);
$data = array(
'select_makes' => form_dropdown('select-make', $this->make_opts, $this->_make),
'select_prices' => form_dropdown('select-price', $price_opts, $this->_price)
);
// changed below
$this->load->_ci_app_path = APPPATH.'modules/search/';
$return = $this->load->view('search/box', $data, TRUE);
$this->load->_ci_app_path = APPPATH; // for not module methods
return $return;
}
It’s ugly but then you don’t have to add the matchbox library just to be able to change the file paths.
The alternative would be instead of using the CI methods just copy the loader methods and change the file paths to be module aware. That was what i meant by adding methods.