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

Zend Framework quick start 的有关问题

WBOY
WBOYOriginal
2016-06-13 13:51:17907browse

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>
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