Using PHP 5.3 and Zend Framework 1.11.7 I've been trying to configure the AutoLoader to auto load my Model classes (for Zend_Db) that resides in the default directory application/models.
I found the following solution:
I can add the following function to the Bootstrap.php:
protected function _initLoader()
{
$loader = new Zend_Loader_Autoloader_Resource (array (
'basePath' => APPLICATION_PATH,
'namespace' => 'Default'));
$loader -> addResourceType ( 'model', 'models', 'Model');
}
it seems like an option that should be easily set in application.ini. so my question is, are there any relevant directives that I can add to application.ini that perform the same task my function performs ?
update
after setting the appnamespace directive, i still need to add the following function:
protected function _initLoader()
{
$loader = new Zend_Loader_Autoloader_Resource (array (
'basePath' => APPLICATION_PATH));
$loader -> addResourceType ( 'model', 'models', 'Model');
}
or else it won't find my model classes.
the only difference is that I removed the attribute 'namespace'.
any other attributes i can add to remove this function entirely ?
thank you! :)
Kfir