在magento后端向客户视图添加新选项卡时出现问题
我对Magento非常陌生,我正在尝试向Magento后端的客户视图添加一个新选项卡 我为它做了一个新的扩展/模块。下面是我的etc/config.xml的一些摘录:在magento后端向客户视图添加新选项卡时出现问题,magento,adminhtml,Magento,Adminhtml,我对Magento非常陌生,我正在尝试向Magento后端的客户视图添加一个新选项卡 我为它做了一个新的扩展/模块。下面是我的etc/config.xml的一些摘录: <global> <blocks> <showidea> <class>Whatever_Extendcustomer_Block</class> </showidea> </blo
<global>
<blocks>
<showidea>
<class>Whatever_Extendcustomer_Block</class>
</showidea>
</blocks>
<!-- ... -->
</global>
<adminhtml>
<layout>
<updates>
<showidea>
<file>whatever_extendcustomer.xml</file>
</showidea>
</updates>
</layout>
</adminhtml>
这里是whatever_extendcustomer.xml文件的内容:
<adminhtml_customer_edit>
<reference name="customer_edit_tabs">
<action method="addTab">
<name>extendcustomer_showidea</name>
<block>extendcustomer/adminhtml_customer_showidea</block>
</action>
</reference>
</adminhtml_customer_edit>
当然,这个块是存在的,它扩展了Mage_Adminhtml_block_模板并实现了Mage_Adminhtml_block_Widget_Tab_界面
当我转到某个客户的详细信息时,我现在得到一个错误:选项卡配置错误。
在Magento的错误日志中:
异常“Mage\u Core\u exception”,消息“无效块类型:
Mage_Extendcustomer_Block_Adminhtml_Customer_Showidea'在中
/var/www/vhosts/whatever/htdocs/app/Mage.php:594
我认为这就是问题所在,因为Mage_Extendcustomer是错误的。它应该是任何。。。但我不知道为什么它是在Mage_uuu而不是我的Whatever_uuu名称空间前加前缀
我希望有人能给我线索!
谢谢。您应该在布局文件中使用showidea而不是extendcustomer:
<adminhtml_customer_edit>
<reference name="customer_edit_tabs">
<action method="addTab">
<name>extendcustomer_showidea</name>
<block>showidea/adminhtml_customer_showidea</block>
</action>
</reference>
</adminhtml_customer_edit>
因为它是您在blocks配置中定义的:
<blocks>
<showidea>
<class>Whatever_Extendcustomer_Block</class>
</showidea>
</blocks>
您应该在布局文件中使用showidea而不是extendcustomer:
<adminhtml_customer_edit>
<reference name="customer_edit_tabs">
<action method="addTab">
<name>extendcustomer_showidea</name>
<block>showidea/adminhtml_customer_showidea</block>
</action>
</reference>
</adminhtml_customer_edit>
因为它是您在blocks配置中定义的:
<blocks>
<showidea>
<class>Whatever_Extendcustomer_Block</class>
</showidea>
</blocks>
就这样。我知道我并不遥远;-谢谢就这样。我知道我并不遥远;-谢谢