Is it possible, to configure the following behaviour in application.ini?
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initAdminModuleAutoloader()
{
$this->_resourceLoader = new Zend_Application_Module_Autoloader(array(
'namespace' => 'Admin',
'basePath' => APPLICATION_PATH . '/modules/admin',
));
$this->_resourceLoader->addResourceTypes(array(
'model' => array(
'namespace' => 'Model',
'path' => 'models'
)
));
}
}
?>
If so, can you please show us an example?
Thanks.
Here are a couple of pointers. First you should have the below line in your application.ini file.
That will make sure that the following function in Zend_Application_Resource_Modules runs
In the above function your module bootstrap is called. You need to have a module bootstrap file in /application/modules/admin called Bootstrap.php with the following code in it:
I'm going to skip a few steps but if you trace through the inheritance classes this will lead to the following function being called in Zend_Application_Module_Autoloader
All of the above resource types will be covered by default for every module that you follow this pattern for. Any others that you need will need to be customized in a bootstrap file.