Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter + Doctrine + HMVC
#11

[eluser]Unknown[/eluser]
For CodeIgniter 1.2.7 + Doctrine 1.2.3 + HMVC structure loading models from "modules/modul_name/model" I just add a read folder function and load each model from modules folder

Code:
// load models from HMVC structured modules
function load_hmvc_models ($dir) {
    if ($handle = opendir($dir)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != ".." && is_dir($dir.$file)) {
                if (is_dir(APPPATH.'/modules/'. $file .'/models')) Doctrine::loadModels(APPPATH.'/modules/'. $file .'/models');
            }
        }
    }
}
load_hmvc_models(APPPATH.'modules/');

All plugin code you can find here http://paste2.org/p/979571




Theme © iAndrew 2016 - Forum software by © MyBB