Question

i have problem in zend framework basic application that class is not found. please help

i have basic structure and added model/tables directory. After my login page is displayed when i submit it then following error occurs

Fatal error: Class 'Application_models_tables_User' not found in E:\zendu\Apache2\htdocs\login\application\controllers\AuthController.php on line 18

Authcontroller.php

class AuthController extends Zend_Controller_Action
{

public function init()
{
    /* Initialize action controller here */
}

public function indexAction()
{
    // action body
}

public function loginAction()
{
    $data = new Application_models_tables_User();

}

models/tables/User.php

class Application_models_tables_User extends Zend_Db_Table
{
protected $_name = 'users';
}

in application.ini

appnamespace = "Application"

i am using zend studio so basic structure is automaticaly created. so i have not to set include path of models.

Was it helpful?

Solution

Have a read through this :

The module resource autoloader sets the folder 'models' to the namespace Model.

I would change your class name to Application_Model_Table_User, and change your 'model/tables' folder to models/Table

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top