繁体   English   中英

Magento,覆盖自定义模块adminhtml块

[英]Magento, override custom modules adminhtml block

我试图覆盖自定义模块adminhtml块。 该块是一个adminhtml选项卡/表单块。

如果正确重写,则会从beforeHtml()函数的关联的tabs.php块中收到错误。

我认为这是我的代码,可以很好地重写:

   <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

我相信错误是在这里引起的...试图初始化块:

文件: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(),
    ));

我的自定义表单类扩展了试图覆盖/覆盖的类。

 class Dev_Affil_Block_Adminhtml_Account_Edit_Tab_Form extends Magestore_Affiliateplus_Block_Adminhtml_Account_Edit_Tab_Form {

我也尝试过扩展普通的法师职业...这也没有用。

 class Dev_Affil_Block_Adminhtml_Account_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {

我在此类中有一个调试stmt,一旦可以得到该stmt输出,就可以了。

任何想法/提示吗?

谢谢S

 <rewrite>
    <class_to_override>
        my_class
    </class_to_override>
 </rewrite>

应该:

 <rewrite>
    <class_to_override>my_class</class_to_override>
 </rewrite>

并且它应该扩展:

 Mage_Adminhtml_Block_Widget_Form

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM