John
John

Reputation: 474

Zend Framework can't find Model

I have a model, Application_Model_DbTable_Login, located in Application > models > DbTable > Application_Model_DbTable_Login.php.

In my controller, LoginController, I am trying to instantiate the Model, but it's saying that it can't find it. Here is the exact error: Fatal error: Class 'Application_Model_DbTable_Login' not found in /usr/local/zend/apache2/htdocs/AssetLibrary/application/controllers/LoginController.php on line 8.

I just started working with Zend Framework. Thanks for any help.

Upvotes: 0

Views: 446

Answers (1)

emeraldjava
emeraldjava

Reputation: 11190

Rename the file

Application_Model_DbTable_Login.php to Login.php 

and ensure the class within is defined as

<?php
class Model_DbTable_Login extends Zend_Db_Table_Abstract
{}

Then in your controller call

$model = new Model_DbTable_Login();

Upvotes: 2

Related Questions