齐博x1钩子自动添加频道参数变量

频道或插件,增加功能的时候,可能要在后台增加开关参数。这个时候只需要增强对应的接口文件即可,比如
创建这样一个文件
\application\shop\ext\setting_get\give_jifen.php
其中setting_get是后台参数的接口标志。give_jifen.php是要增加的参数,文件名可随意。
上面的\application\shop\ext\ 代表只针对商城频道增加参数
代码如下

<?php

$array = [
        [
                'c_key'=>'group_reply_2jftype',
                'title'=>'(额外奖励)发表评论回复奖励哪种虚拟币',
                'c_descrip'=>'特别提醒,请不要跟上面的重复选择同一种类型',
                'c_value'=>'-1',
                'form_type'=>'jftype',
                'ifsys'=>0,
                'list'=>-4,
        ],
        [
                'c_key'=>'group_reply_2jftype_money',
                'title'=>'(额外奖励)发表评论回复奖励相应的虚拟币值',
                'c_descrip'=>'0或留空则不做处理',
                'form_type'=>'usergroup',
                'ifsys'=>0,
                'list'=>-5,
        ],
];

if (is_array($this->config)) {
    $this->config = array_merge($this->config,$array);
}else{
    $this->config = $array;
}
posted @ 2021-11-25 02:14  半抹灯芯  阅读(23)  评论(0编辑  收藏  举报