找不到我的映射器类


Zend my mapper class is not found

我正在使用模块,这是结构:

-application
    -modules
        -affaire
            -controllers
                -ProfileController.php
            -models
                -Affaire.php
                -AffaireMapper.php

问题出在配置文件控制器的索引操作中,当我调用:

$affaireMapper = new Affaire_Model_AffaireMapper();

我得到的错误Affaire_Model_AffaireMapper找不到...你知道钻头:P我怀疑这是因为我的模块名称是用小写写的。我还在AffaireMapper中仔细检查了我的类名.php以确保它没有输入错误。这个名字是Affaire_Model_AffaireMapper顺便说一句!

如果是因为我的怀疑,有什么办法可以保留我的小写名字"外遇"吗?我想要小写的,所以我的;就像:"something.com/affaire/profile"。无论如何,我是 Zend 的新手,所以它可能(或者:P)是一个新手错误!

找到解决方案,我忘记了模块的引导.php文件和应用程序中的变量 ressources.modules[] = ".ini。当我意识到它只发生在模块内的模型时,我能够找到一个主题:zend模块模型

linux 服务器剪切类的名称以生成类文件的补丁,在这种情况下,执行以下操作:

$affaireMapper = 新的 affaire_models_AffaireMapper();

结束 将类重命名为:

affaire_models_AffaireMapper