Magento的模块config.xml完整指南?

时间:2017-09-07 17:51:40

标签: php xml magento config

很难找到模块配置文件的完整指南(通常放在app / code / local / PackageName / ModuleName / etc / config.xml中)。我理解一些基本的标签,如

<global>
    <models>
        <customclass>
            <class>PackageName_CustomClass_Model</class>
        </customclass>
    </models>
</global>

它声明了一个模型,我可以使用Mage::getModel('modulename/customclass')获得此模型类

然而,还有许多其他标签对我来说根本不熟悉,并且很难弄清楚哪些标签做了什么,是否有任何完整的指南可用于所有这些标签?或者例如有人可以解释这是做什么的吗?

<global>
    <sales>
        <quote>
            <totals>
                <modulename>
                    <class>modulename/sales_quote_address_total_modulename</class>
                    <after>subtotal</after>
                    <before>shipping</before>
                </modulename>
            </totals>
        </quote>
    </sales>
</global>

这是如何在php文件中调用的?感谢。

1 个答案:

答案 0 :(得分:3)

我很久以前就提过过文章了。

目前该网站已关闭,因此我从webarchive分享了这些链接。

config.xml: https://web.archive.org/web/20160329183248/http://www.ecomdev.org:80/2010/08/31/magento-module-configuration-file-reference.html

system.xml https://web.archive.org/web/20160318205048/http://www.ecomdev.org:80/2010/10/27/custom-configuration-fields-in-magento.html

希望它有所帮助!

相关问题