I have a MVC that is structored like this
Modules
-Mod1
-controller
-Model
-View
-Mod2
-controller
-Model
-View
and than I have an autoload function that I need it to load all the files in the directory Model, regardless of what Module it is
// Autoload all models files in all Modules.
function models_autoload($class)
{ $classFile = str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', strtolower($class) )));
$classFile.='.php';
$files=LUCID_MODULES.'./model/'.$classFile;
if(file_exists($files)==FALSE)
{
return FALSE;
}
include ($files);
}
spl_autoload_register('models_autoload');
my question is, how do I specify in my auto load function above to look recursively in all the Modules for a Model Directory and include all files in models directories.