如何在Magento中设置全局配置? [英] How to set global configuration in Magento?
本文介绍了如何在Magento中设置全局配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将谈论Magento中的一些配置问题:
I am going to talking about some the config issue in Magento:
让我假设:
如果我想在 app/etc/config.xml
中为以下项声明一些全局配置:
If I want to declare some global configuration in app/etc/config.xml
for:
我想将刷新页面的延迟时间设置为 5000ms .
在代码中,我将尝试如下所示:
In the code, I will try to get like below:
Mage::app()->getConfig()->getDelayTime();
或
Mage::app()->getConfig()->get('delaytime');
我应该怎么办?
推荐答案
在default
节点内部放置类似
<settings>
<delaytime>5000</delaytime>
</settings>
然后获取此值:
<?php Mage::getStoreConfig('settings/delaytime'); ?>
这篇关于如何在Magento中设置全局配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文