ITeye博客

增加Magento后台管理功能三:在后台设置(System/Configuration)中加入自定义设置

cgzhang · 2010-11-30 16:17 · Magento · 编程语言 · XML · 配置管理 · Markdown

在模块的etc目录下新建system.xml配置文件,内容如下: [code="xml"] Settings 1 text 500 1 0 0 Enabled select adminhtml/system_config_source_yesno 10 1 0 0 Settings2 text 2 1 1 0 [/code] 可以通过Mage::getStoreConfig('[section 标识符]/[group标识符]/[field标识符]')来获取设置的值。 Mage::getStoreConfigFlag方法用来返回bool类型的结果,通过用于开关模块的设置。 如果是自定义section, 则需要在config.xml中加入权限设置: [code="xml"] <[自定义section标识符]> [出现在权限列表中的标题] [/code] 对于新加入的section,需要后台管理用户重新登录后才能生效。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。