DaoKeCMS插件配置管理方案📅 2026-04-13  |  👁 848 次浏览

DaoKeCMS插件的配置管理使用tuanyu_config表存储键值对配置。

写入配置

set_config('adslot_delay', 3000);
set_config('adslot_position', 'bottom-right');

读取配置

$delay = C('adslot_delay', 3000);
$position = C('adslot_position', 'bottom-right');

配置键命名规范

  • 建议用插件slug作为前缀如adslot_
  • 避免与系统配置键冲突
  • 同一插件的配置键统一前缀
  • 在plugin.json中声明config_prefix(如果是模板)

配置管理页面通过后台设置页实现,POST处理用set_config写入,前台用C()读取。

芒阳网络团域cms开发中心

Copyright © 2023 刀客CMS内容管理系统