In the module A I need to get some data from file config.xml of modules B and C.
Are there any methods or classes dedicated for this?
Especialy I need to get XML structure and values of node <default>
so that I can restore default values of system configuration of modules B and C. Below is example from config.xml of Wishlist module:
<config>
<default>
<wishlist>
<general>
<active>1</active>
</general>
<email>
<email_identity>general</email_identity>
<email_template>wishlist_email_email_template</email_template>
</email>
</wishlist>
</default>
</config>
As far as I know Magento loads config.xml files of all modules, so I was wondering maybe this data is already cached and can be retrieved from cache somehow? If not, how to retrieve it programaticaly?
Best Answer
You can get a certain node from the config like this.
this should retrive the value of
The problem is that it does not retrieve the value from a specific file. it gets the value from the merged config.
If you want values from a specific file, do this.
You will have in the
$xml
variable the loaded xml file and your can usexpath
to find a specific node.