---
title: "增加Magento后台管理功能三：在后台设置(System/Configuration)中加入自定义设置"
author: "cgzhang"
date: "2010-11-30T16:17:26Z"
tags: ["XML", "配置管理"]
categories: ["编程语言"]
slug: "magento-system-configuration"
draft: false
lastmod: "2010-11-30T16:18:02Z"
id: 829443
url: "https://magentosh.iteye.com/blog/829443"
---

在模块的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"] &lt;\[自定义section标识符]&gt; \[出现在权限列表中的标题] \[/code] 对于新加入的section，需要后台管理用户重新登录后才能生效。