Zend autloading different namespaces from the same directory?
Posted
by
Sled
on Stack Overflow
See other posts from Stack Overflow
or by Sled
Published on 2010-12-22T21:34:38Z
Indexed on
2010/12/26
9:54 UTC
Read the original article
Hit count: 195
Hey guys,
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)
© Stack Overflow or respective owner