<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Aps_Weicot>
<version>0.2.0</version>
</Aps_Weicot>
</modules>
<frontend>
<!--加载布局-->
<layout>
<updates>
<weicot>
<file>weicot.xml</file>
</weicot>
</updates>
</layout>
<!--设置模块前端-->
<routers>
<weicot>
<use>standard</use>
<args>
<module>Aps_Weicot</module>
<frontName>weicot</frontName>
</args>
</weicot>
</routers>
</frontend>
<global>
<models>
<weicot>
<!--启用模型-->
<class>Aps_Weicot_Model</class>
<resourceModel>weicot_mysql4</resourceModel>
</weicot>
<weicot_mysql4>
<!--为资源模型添加实体-->
<class>Aps_Weicot_Model_Resource_Mysql4</class>
<entities>
<blogpost>
<table>blog_post</table>
</blogpost>
</entities>
</weicot_mysql4>
</models>
<!--设置读写适配器-->
<resources>
<weicot_write>
<connection>
<use>default_write</use>
</connection>
</weicot_write>
<weicot_red>
<connection>
<use>default_read</use>
</connection>
</weicot_red>
<weicot_setup>
<!--配置资源模型-->
<setup>
<module>Aps_Weicot</module>
<class>Aps_Weicot_Model_Setup_Mysql4_Setup</class>
</setup>
<connection>
<!--连接资源模型-->
<use>core_setup</use>
</connection>
</weicot_setup>
</resources>
<!--板块-->
<blocks>
<weicot>
<class>Aps_Weicot_Block</class>
</weicot>
</blocks>
<!--邮件模板 标签 和邮件模板声明!-->
<template>
<email>
<weicot_options_weicot_email_exist_pay_weicot_template translate="label" model="weicot">
<label>Weicot Pay Email</label>
<file>weicot/exist_pay.html</file>
<type>html</type>
</weicot_options_weicot_email_exist_pay_weicot_template>
</email>
</template>
<!--加载帮助类 后台的-->
<helpers>
<weicot>
<class>Aps_Weicot_Helper</class>
</weicot>
</helpers>
</global>
<!--添加后台 acl(Access Control List) 权限-->
<adminhtml>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<weicot_options>
<title>Store Weicot Com Module Section</title>
</weicot_options>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</adminhtml>
<!--global 全局-->
</config>
Magento system.xml
<config>
<!--创建新标签页-->
<tabs>
<weicotconfig translate="label" module="weicot">
<label>Weicot Config</label>
<sort_order>99999</sort_order>
</weicotconfig>
</tabs>
<!--设置标签页的基本内容-->
<sections>
<weicot_options translate="label" module="weicot">
<label>Weicot Config Options</label>
<tab>weicotconfig</tab>
<fontend_type>text</fontend_type>
<sort_srder>1000</sort_srder>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<!--添加选项组 节点-->
<groups>
<messages translate="label" >
<label>Weicot Demo of Config Fields</label>
<frontend_type>text</frontend_type>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<!--添加单独的配置选项 到子节点-->
<fields>
<weicot_message>
<label>Massage</label>
<frontend_type>select</frontend_type>
<!--adding a source model-->
<source_model>weicot/com</source_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</weicot_message>
</fields>
</messages>
<example>
<!--在已有的配置段中或者组中添加数据-->
<label>Example of Adding a Group</label>
<frontend_type>text</frontend_type>
<sort_order>2</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</example>
<!--增加 email 选项 和 模板-->
<weicot_email translate="label">
<label>Weicot Pay Email</label>
<frontend>text</frontend>
<sort_order>5</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<fields>
<exist_pay_weicot_template translate="label">
<label>Weicot Pay Email</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_template</source_model>
<srot_order>3</srot_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</exist_pay_weicot_template>
</fields>
</weicot_email>
</groups>
</weicot_options>
</sections>
</config>
转载请注明:(●--●) Hello.My Weicot » Magento config.xml system.xml 解释