Home >Backend Development >PHP Tutorial >无法找到类解决思路

无法找到类解决思路

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 12:11:361347browse

无法找到类
在model里写了个类如下
class Debut extends Zend_Db_Table{
    protected  $_name = 'debut';
    protected  $_id = 'id';
    
    public function getInfos(){
        $select = $this->_db->select();
        $select->from($this->_name);
        $result = $this->_db->fetchAll($select);
        return $result;
    } 
}
在Action里new对象报错
错误信息:Fatal error: Class 'Debut' not found in C:\Users\admin\Zend\workspaces\DefaultWorkspace7\test\application\controllers\TestController.php on line 4
在编译环境里可以找到对应类,请问为啥啊?
------解决思路----------------------
你没有在 TestController.php 中引入 Debut 类定义
可能的原因是:
你没有在框架中执行你的程序
Debut 类定义文件不符框架约定的命名规则
Debut 类定义文件不在框架约定的存放位置

------解决思路----------------------
你用命名空间了木有?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn