Zend Framework modular app, can't load models for each module, autoloading models?
- by EricP
Is there a way to have models for each module? I have 3 modules, one is a "contacts" module.
I created a model for it in modules/contacts/models/Codes.php
Codes Controller
class Contacts_CodesController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
$this->view->messages = $this->_helper->flashMessenger->getMessages();
}
public function indexAction()
{
$codesTable = new Contacts_Model_Codes();
}
Codes Model:
class Contacts_Model_Codes extends Zend_Db_Table
{
protected $_name = 'codes';
}
The error I get:
Fatal error: Class 'Contacts_Model_Codes' not found in /Applications/MAMP/htdocs/zf_site/application/modules/contacts/controllers/CodesController.php on line 26
thanks