我试图覆盖一个自定义模块adminhtml块。该块是一个adminhtml选项卡/表单块。
如果重写正确,则从关联的tabs.php block...in beforeHtml()函数中得到一个错误。
以下是我认为适合重写的代码:
<blocks>
<devaf>
<class>Dev_Affil_Block</class>
</devaf>
<affiliateplus>
<rewrite>
<adminhtml_account_edit_tab_form>
Dev_Affil_Block_Adminhtml_Account_Edit_Tab_Form
</adminhtml_account_edit_tab_form>
</rewrite>
</affiliateplus>
</blocks>实际错误是:
20 3.5764 29562296 Mage_Core_Block_Abstract->toHtml( ) ..\List.php:43
21 3.5767 29562448 Magestore_Affiliateplus_Block_Adminhtml_Account_Edit_Tabs->_beforeToHtml( ) ..\Abstract.php:862
exception 'Mage_Core_Exception' with message 'Invalid block type: Dev_Affil_Block_Adminhtml_Account_Edit_Tab_Form我相信这个错误是由here...trying在这个块中插入的:
文件: Magestore_Affiliateplus_Block_Adminhtml_Account_Edit_Tabs
$this->addTab('general_section', array(
'label' => Mage::helper('affiliateplus')->__('General Information'),
'title' => Mage::helper('affiliateplus')->__('General Information'),
'content' => $this->getLayout()->createBlock('affiliateplus/adminhtml_account_edit_tab_form')->toHtml(),
));我的自定义表单类,扩展了试图重写/覆盖的类im。
class Dev_Affil_Block_Adminhtml_Account_Edit_Tab_Form extends Magestore_Affiliateplus_Block_Adminhtml_Account_Edit_Tab_Form {我也尝试过扩展通常的法师class...this也不起作用。
class Dev_Affil_Block_Adminhtml_Account_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {我在这个类中有一个调试stmt,一旦我能够得到stmt输出,我就会没事。
有人有什么想法/建议吗?
谢谢S
发布于 2014-08-12 17:20:50
<rewrite>
<class_to_override>
my_class
</class_to_override>
</rewrite>应:
<rewrite>
<class_to_override>my_class</class_to_override>
</rewrite>它还应扩大:
Mage_Adminhtml_Block_Widget_Formhttps://stackoverflow.com/questions/25260196
复制相似问题