Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento config.xml system.xml adminhtml.xml

Tags:

magento

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.

like image 386
Slimshadddyyy Avatar asked Mar 25 '13 05:03

Slimshadddyyy


People also ask

What is System xml in Magento?

The system. xml file allows you to manage the Magento system configuration. Use this topic as a general reference for the system.

How do you validate system configuration?

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.

What is the configuration file for Magento?

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.


1 Answers

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();
like image 150
Alan Storm Avatar answered Sep 21 '22 10:09

Alan Storm