讨论 技术讨论 模块开发中, 模块可配置项问题

模块开发中, 模块可配置项问题

WX_pX4 发表于    阅读:97    回复:2

问题描述:

在开发示例程序中的,`config.json`中的配置项给了例子如下:

"config": {
    "testText": [
        [
            "text",
            "文字参数"
        ]
    ],
    "testEnable": [
        [
            "switch",
            "功能启用"
        ]
    ],
    "testSelect": [
        [
            "select",
            "下拉选择"
        ],
        [
            "optionType",
            "Module\\Demo\\Type\\DemoType"
        ]
    ]
}

请问这里是指这些配置项的value 是在这里hard-coded 吗?还是说他们与`module/Demo/Admin/Controller/ConfigController.php`有关联,实际值是在ConfigController中设置的?

环境信息:

PHP版本、系统版本、模块版本等

复现步骤:

1

2

3

建议与意见:

1

2

3

评论

① config.json 中的配置项,在 系统管理 → 模块管理 → 模块配置 中设置,通常用于模块的“系统级”配置。

② module/Demo/Admin/Controller/ConfigController.php 中的配置是根据系统实际需求任意配置,通常用于业务功能的配置,和 config.json 中的配置无关。


 

ok. thanks.

 
1
我来评论
QQ
微信