Magento中覆盖同一个核心文件的多个模块 [英] Multiple modules overriding same core file in Magento
本文介绍了Magento中覆盖同一个核心文件的多个模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Magento如何处理覆盖同一核心文件的多个模块?是否有可能?怎么做?
How does Magento handle multiple modules overriding the same core file? Is it possible? How is it done?
推荐答案
您有3种解决冲突的选择:
You have 3 choices for resolving conflicts:
- 将代码从一个冲突的文件合并到另一个文件中,然后关闭其中的重写config.xml
- 关闭一个config.xml中的重写,然后使冲突的扩展PHP文件扩展另一个扩展
- 使用
<depends>
功能使一个扩展依赖于另一个.然后,他们将按照该顺序重写
- Merge the code from one conflicting file into another and switch off the rewrite config.xml in one
- Switch off the rewrite in one config.xml and then make the conflicting extension PHP file extend the other extension
- Use the
<depends>
capability to make one extension depend on another. They will then rewrite in that order
示例(选项2)
class A_Extension_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onepage
您将其更改为:
class A_Extension_Model_Type_Onepage extends B_Extension_Model_Type_Onepage
更多信息@ http://www.webshopapps. com/blog/2010/11/resolving-magento-extension-conflicts/
这篇关于Magento中覆盖同一个核心文件的多个模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文