Model Class not found error in a custom Zend Module

For programming and general questions on Zend Framework

Model Class not found error in a custom Zend Module

Postby yorkspatter on Wed Aug 08, 2012 3:30 pm

First time with Zend, I'm writing an application using some custom modules, and I get a class not found error accessing the index controller: PHP Fatal error:
Code: Select all
Class 'Entity_Model_DbTable_EntityGroup' not found in /application/modules/Entity/controllers/IndexController.php
The controller's indexAction() function loads & echos a debug statement. I have also checked that the modules path in application.ini is correct. any suggestions?

Very trimmed code structure follows:

File: application/modules/Entity/controllers/IndexController.php
Code: Select all
class Entity_IndexController extends Zend_Controller_Action {
    public function init() {  }

    public function indexAction() {
        echo "In Controller"
   $entity_groups = new Entity_Model_DbTable_EntityGroup();
   $this->view->entity_groups = $entity_groups->fetchAll();
    }
}


File: application/modules/Entity/models/DbTable/EntityGroup.php
Code: Select all
class Entity_Model_DbTable_EntityGroup extends Zend_Db_Table_Abstract {
}
yorkspatter
 
Posts: 3
Joined: Wed Aug 08, 2012 3:18 pm

Re: Model Class not found error in a custom Zend Module

Postby yorkspatter on Thu Aug 09, 2012 12:38 pm

[FIXED] Bit of digging around, found I needed a blank Bootstrap.php for the module

Code: Select all
<?
class Entity_Bootstrap extends Zend_Application_Module_Bootstrap {}
yorkspatter
 
Posts: 3
Joined: Wed Aug 08, 2012 3:18 pm


Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 3 guests