Ok, this is driving me nuts!
I have a directory structure as follows:
application
- modules
-- default
--- controllers
--- models
---- DbTable
---- Cachmapper.php
--- views
My config file looks like this
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] =
The application seems to work, if I navigate to localhost, it correctly goes to the index controller. But, for some reason it refuses to load any models.
Fatal error: Class 'Model_Cachmapper' not found in .............................../application/modules/default/controllers/IndexController.php on line 26
Ideas?
Thanks
I would add a bootstrap class to the module as otherwise the module loader doesn't know about it.
And store in applications/default/Bootstrap.php
http://akrabat.com/modules has some more info.
I am a novice ZF user, so this may not be 'correct' but I have had no problems using DB Models this way. My directory structure looks like this:
In my application/public/index.php I have the following code:
My application namespace is Application (if you couldn't tell). My database models look like this (located in application/models/DbTable:
Also, the relevant portions of application/configs/application.ini:
Add your models directory to your includePaths
I have:
I know, your models lies under your modules, but should be possible to do somehow. Maybe in the bootstrap instead of application.ini
Att.: Rob
Hi Rob,
Well i'm confused. Because i actually bought your book 'Zend Framework In Action'.
And in the bootstrap of the 'Places' app in the sourcecode, you have the following.
I know that the source is written for an older ZF version. My current app i'm working on is based on Zend_Application, and if i remove the models folder from my includePaths, the loader can't find my models.
Here's a working version (one of them, at least), for ZF 1.10.x and probably earlier, too.
index.php
application.ini - the relevant parts
and in application/Bootstrap.php