I began to document myself regarding the Zend Framework, as I will soon start using it in production. Everything worked fine until I started using and working with models :).
The default value for models based on Zend recommendations is application/models/DbTablewhere all models will be selected. This location makes me call the type model Application_Model_DbTable_Actors. For me, this is a very long model name, not easy to use.
The directory structure I want to get looks something like this:
application/
models/
actors/
ActorsMapper.php
Actor.php
books/
BooksMapper.php
Book.php
and etc.
So, all my models will be in the directory models, but grouped into their own directories.
ActorsMapper Actor ( Zend_Db_Table Zend_Db_Row).
, , , - $actors = new ActorsMapper(), Fatal error: Class not found, .
, models include_path:
include
:
, set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
realpath(APPLICATION_PATH . '/models'),
get_include_path(),
)));
, .
Zend_Db_Table, , .
.
p.s. zend - 1.11.1