简体   繁体   English

zend框架:找不到类

[英]zend framework: class not found

i have problem in zend framework basic application that class is not found. 我在zend Framework基本应用程序中遇到未找到类的问题。 please help 请帮忙

i have basic structure and added model/tables directory. 我具有基本结构并添加了model / tables目录。 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 致命错误 :在第18行的E:\\ zendu \\ Apache2 \\ htdocs \\ login \\ application \\ controllers \\ AuthController.php中找不到类'Application_models_tables_User'

Authcontroller.php 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 型号/表/User.php

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

in application.ini 在application.ini中

appnamespace = "Application"

i am using zend studio so basic structure is automaticaly created. 我正在使用zend Studio,因此会自动创建基本结构。 so i have not to set include path of models. 所以我不必设置模型的包含路径。

Have a read through this : 阅读以下内容

The module resource autoloader sets the folder 'models' to the namespace Model . 模块资源自动加载器将文件夹“ models”设置为名称空间Model

I would change your class name to Application_Model_Table_User , and change your 'model/tables' folder to models/Table 我将您的类名称更改为Application_Model_Table_User ,并将您的“ model / tables”文件夹更改为models/Table

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM