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

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

问题描述

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

解决方案

如果您有良好的调试器Xdebug或Zend Debugger,则可以在类Mage_Core_Model_Config的方法loadModulesConfiguration中检查变量$mergeToObject. /p>

或者是坏人的方式:-),您在同一位置死掉了脚本,但是在返回$mergeToObject;之前就执行了print_r($mergeToObject);.

您可能会在此方法中看到是否也加载了模块.

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

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

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

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?

解决方案

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.

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. ;-)

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.

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天全站免登陆