Home > Backend Development > PHP Tutorial > Zend Framework quick start 的有关问题

Zend Framework quick start 的有关问题

WBOY
Release: 2016-06-13 10:00:19
Original
1039 people have browsed it

Zend Framework quick start 的问题
做完 create-model这一步的时候
执行guestbook,提示 PHP Fatal error: Class 'Application_Model_GuestbookMapper' not found 

有人知道什么原因吗?需要的文件明明存在。

------解决方案--------------------
它是用autoloader的,不用自己require,
你再查查看
------解决方案--------------------
没有加载到 GuestbookMapper 这个资源,是不是前面的步骤少了什么?在网上查到一个办法:
修改 Bootstrap.php 文件,在 _initDoctype() 方法后面加入以下代码:

PHP code
$loader = new Zend_Loader_Autoloader_Resource (array (                                                  'basePath'  => APPLICATION_PATH,                                                  'namespace' => 'Application',                                               ));$loader -> addResourceType ('model', 'models', 'Model');<div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template