How do I eliminate the Zend Framework Application (or Model Namespace)?
There are several ways to do it.
1. Configuration (application.ini)
appnamespace = ""
2. Bootstrap class by calling the module autoloader class
$moduleLoader = new Zend_Application_Module_Autoloader(array(
'namespace' => '',
'basePath' => APPLICATION_PATH)
);
3. Bootstrap class by calling the resource autoloader class
$resourceLoader = new Zend_Loader_Autoloader_Resource(array(
'basePath' => APPLICATION_PATH,
'namespace' => ''
));
$resourceLoader->addResourceTypes(array(
'model' => array(
'namespace' => 'Model',
'path' => 'models'
)
));
#3 is from here.
There's a call hierarchy from the choices above which is easy to figure once you're using it. Depending on your use-case, you might need one or a combination of them. I hope this helps.
No comments:
Post a Comment