views:

17

answers:

1

Hiya. I'm trying to create a Zend Framework project using PHP 5.3.2 and Zend Framework 1.10.3.

i created the source files of the project using the zend framework tool and the db related classes i created with zend-db-model-generator.

example:

in models directory i have the following:

FbUser.php - class Default_Model_FbUser
FbUserMapper.php - class Default_Model_FbUserMapper
DbTable/FbUser.php - class Default_Model_DbTable_FbUser

The models in the models directory should be included automatically when I use them in one of the controllers, but it seems that it doesn't.

what should i configure in order for the db class models will be auto-included when used ?

update

I tried adding the following code to the bootstrap file:

$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Default_');

the autoloader still looks for Default/Model/FbUser.php in include path instead of Model/FbUser.php in the zf project.

A: 

I did not need to use Zend_Loader_Autoloader at all, although it's a cool component to auto-load classes in your include path.

i need to add to application.ini which is the main config of the application, the following line:

appnamespace = "Default_"

The program understands the application name space and then loads the db model classes properly.

ufk