I have a models directory in my project, and I would like to save/files classes there with different namespaces.
Example:
models/User.php with classname Model_User
models/Table_User.php with classname Model_Table_User
For the first namespace I have this in bootstrap.php
$resourceLoader->addResourceTypes(array(
'model' => array(
'namespace' => 'Model',
'path' => 'models'
)
));
I can’t figure out how to add the second namespace so it detects files starting with Table_ Any ideas?
For now I’ve added a second directory named ‘tables’ but it’s getting confusing because I have each model name twice (once in the models diretory and once in the tables directory)
That’s something I do myself.
I have “Model_” sat in ‘{APPLICATION_PATH}/models/’ and “DbTable_” sat in ‘{APPLICATION_PATH}/models/dbtables/’.
You should of course modify this to according to your classnames and folder structure.
APPLICATION_PATH is defined in your index.php — but I don’t remember if it contains a trailing slash, so check that just in case. (I’m not on my pc at the moment so I cannot check…)
Simple as that! 🙂