Zend Framework modular app, can't load models for each module, autoloading models?

Posted by EricP on Stack Overflow See other posts from Stack Overflow or by EricP
Published on 2009-10-06T03:54:36Z Indexed on 2010/06/15 5:52 UTC
Read the original article Hit count: 271

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about model