0

I want to use value of config.xml and system.xml file from module in a file when located in "lib" directory in root of magento, but I don't know how!

Tried many searches but didn't find my answer, because all of them use in classes and models of self extension, I need read from app/community/Company/Mymodule/etc/config.xml ...

1

The whole configuration is merged into one big XML structure, therefore you can just access it via:

Mage::getConfig()->getNode('globals/model/...');

But I'm not sure what happens with the system.xml

Have a look here, this should do.

\Mage_Adminhtml_Model_Config::_initSectionsAndTabs

    $config = Mage::getConfig()->loadModulesConfiguration('system.xml')
        ->applyExtends();

    Mage::dispatchEvent('adminhtml_init_system_config', array('config' => $config));
    $this->_sections = $config->getNode('sections');
    $this->_tabs = $config->getNode('tabs');
6
  • enough if I can use config.xml ...
    – sIiiS
    Dec 24 '13 at 9:10
  • any solution for reading from config.xml? Not working "getNode...."
    – sIiiS
    Dec 24 '13 at 19:58
  • You are in Magento context, are you? Dec 24 '13 at 23:26
  • I have a file in "lib" directory and want to read and use a config value from an extension in community/Mycompnay/Mymodule/etc/config.xml(or system.xml) folder... yes I am!
    – sIiiS
    Dec 25 '13 at 8:26
  • 1
    problem solved, I moved my file from "lib" folder to "extension" folder!
    – sIiiS
    Dec 25 '13 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.