2012-06-21 31 views
0

我是Magento的新手,我想在我創建的模塊的/etc/local.xml中添加一些LDAP congiruations,但我無法找到如何...我們如何訪問Magento模塊配置?

很肯定每個人都知道這一點,我不能不能找到適當的文件在網絡上的如何從config.xml文件中得到具體的配置

+1

您不要將自己的配置節點放在local.xml中,而是將它們放在模塊的config.xml中。 http://alanstorm.com/custom_magento_system_configuration –

+0

對不起,我的意思是/etc/config.xml而不是/etc/local.xml。但感謝這篇文章,它幫助我找到了如何獲取設置! –

回答

0

例子:

設置在[my_module]在/ etc /config.xml

<connexions> 
    <ldap> 
     <host><![CDATA[LDAP_HOST]]></host> 
     <username><![CDATA[USERNAME]]></username> 
     <password><![CDATA[PASSWORD]]></password> 
     <baseDn><![CDATA[BASE_DN]]></baseDn> 
    </ldap> 
</connexions> 

調用方法:

Mage::getConfig()->loadModulesConfiguration('config.xml') 
       ->getNode('connexions/ldap') 
       ->asXML() 
相關問題