iamjim wrote:
Here is what works for me in my module (Auth), to autoload files in the
module subdirectories
form, service, and models.
class Auth_Bootstrap extends Zend_Application_Module_Bootstrap
{
protected function _initAuthAutoload()
{
$autoloader = new Zend_Application_Module_Autoloader(array(
'namespace' => 'Auth_',
'basePath' => APPLICATION_PATH . '/modules/auth',
'resourceTypes' => array (
'form' => array(
'path' => 'forms',
'namespace' => 'Form',
),
'model' => array(
'path' => 'models',
'namespace' => 'Model',
),
'service' => array(
'path' => 'service',
'namespace' => 'Service',
)
)
));
return $autoloader;
}
}
Thanks for the response. I now have this in the
application/modules/job/Bootstrap.php
[code]
class Job_Bootstrap extends Zend_Application_Module_Bootstrap
{
protected function _initAuthAutoload()
{
$autoloader = new Zend_Application_Module_Autoloader(array(
'namespace' => 'Job_',
'basePath' => APPLICATION_PATH . '/modules/job',
'resourceTypes' => array (
'form' => array(
'path' => 'forms',
'namespace' => 'Form',
),
'model' => array(
'path' => 'models',
'namespace' => 'Model',
),
'service' => array(
'path' => 'service',
'namespace' => 'Service',
)
)
));
return $autoloader;
}
}
[/code]
But still autoload does not work. The class Job_Bootstrap in the above
file is never instantiated.
I get the error:
Fatal error: Class 'Job_Model_Index' not found
My directory structure is
application
configs
controller
models
modules
admin...
auth
controllers
forms
models
services
views
Bootstrap.php
main...
library
public
tests
I notice that you have a default module inside your modules directory.
when Zend_Tool creates
a new project the default modules controllers, models, views are located in
the application directory.
Hope this is helpful.
jim
--
With warm regards,
Sudheer. S
Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net,
Personal: http://sudheer.net