什么时候magento Mage :: getModel('customer / form');失败?

时间:2011-09-17 19:03:39

标签: magento

我在控制器类中有以下两行代码。

        $customerForm = Mage::getModel('customer/form');
        $customerForm->setFormCode('customer_account_create')
            ->setEntity($customer);

我收到“致命错误:在...中的非对象上调用成员函数setFormCode()” 在这两行中的第二行。

什么可能导致第一行返回“非对象”? (我猜它失败并返回null,但为什么会发生这种情况?)

我不确定这是否相关,但这种情况发生在使用企业版magento(Magento ver.1.8.0.0)的网站上。

1 个答案:

答案 0 :(得分:1)

查看你的exeption.log,你应该在那里找到一些想法。如果Mage_Customer模块被禁用,您可以重写“客户/表单”模型,或者甚至缺少Mage_Customer_Model_Form类的文件,则可能会发生这种情况。

相关问题