Can anyone pls shed some light on below topic ?
What is a clear difference between Magento's etc/ config.xml, system.xml and adminhtml.xml ?
What code differentiate three of the above XML files ?
It is just for the core magento knowledge.
The system. xml file allows you to manage the Magento system configuration. Use this topic as a general reference for the system.
Validation in Configuration. It is very simple. You just need to add “validate” tag for field in system. xml file and pass validation class between validate tag.
Magento provides configuration files that enable you to easily customize a component. We also enable you to create new configuration types to extend default functionality.
The config.xml
files contain global configuration information for Magento, available to all Magento "areas". In the beginning, there were no adminhtml.xml
configuration files. This information was located in config.xml
. Later versions of Magento broke this information out into adminhtml.xml
files, and only merged these files with the other config.xml
files when the system was serving backend admin pages.
The system.xml
files are not a part of the global configuration. They're a separate system for automatically building UI in the backend application for setting system configuration values.
How Magento loads these files is a long involved tale that's not appropriate for a Stack Overflow answer. I have a four article series that covers this in detail if you're interested in that sort of thing.
The short version is config.xml
files are loaded here
#File: app/code/core/Mage/Core/Model/Config.php
$this->loadModulesConfiguration(array('config.xml',$resourceConfig), $this);
The adminhtml.xml
files are loaded here
#File: app/code/core/Mage/Admin/Model/Config.php
Mage::getConfig()->loadModulesConfiguration('adminhtml.xml', $adminhtmlConfig);
and system.xml
files are loaded here
#File: app/code/core/Mage/Adminhtml/Model/Config.php
$config = Mage::getConfig()->loadModulesConfiguration('system.xml')
->applyExtends();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With