我怎么知道我的 Config.xml 文件是否在 Magento 中工作? [英] How do I know whether my Config.xml file is working in Magento?

查看:22
本文介绍了我怎么知道我的 Config.xml 文件是否在 Magento 中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个示例模块,但我不确定它的 /module/etc/config.xml 文件是否正在加载.我敢肯定,这只是一个问题.有什么办法可以确定这个文件是否正在加载?

I have created a sample module, but I am not sure if its /module/etc/config.xml file is getting loaded. I am sure there is a problem in that only. Is there a way that I can find out whether this file is getting loaded?

推荐答案

如果你有好的调试器 Xdebug 或 Zend Debugger,你可以在方法 loadModulesConfiguration<中检查变量 $mergeToObjectMage_Core_Model_Config 的/code>.

If you have a good debugger Xdebug or Zend Debugger, you can check the variable $mergeToObject in the method loadModulesConfiguration of the class Mage_Core_Model_Config.

或者坏人的方式:-),你在同一个地方死了脚本,但在 return $mergeToObject; 之前你做了 print_r($mergeToObject);.

Or the bad guy way :-), you die the script at the same place but just before return $mergeToObject; you do print_r($mergeToObject);.

你可以在这个方法中看到你的模块是否也被加载了.

You could see in this method if your module is loaded too.

调试器是你最好的朋友.;-)

A debugger is your best friend. ;-)

所有这些都允许检查从您的 config.xml 加载的内容,但并不意味着您的 config.xml 中的语法正确以加载模型或别的.您应该查看核心模块的其他 config.xml 以帮助您.

All of this allow to check what is loaded from your config.xml but doesn't mean that the syntax is correct into your config.xml to load models or else. You should take a look in other config.xml of the core modules to help you.

我忘记了,检查您的模块是否在缓存刷新后被 Magento 正确加载和识别,您应该查看系统 > 配置 > 高级选项卡,看看您的模块名称是否出现.

I have forgotten, check if you module is correctly loaded and recognized by Magento after a cache flush, you should take a look in the System > configuration > advanced tab and see if your module name appears.

这篇关于我怎么知道我的 Config.xml 文件是否在 Magento 中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆