如何对得到一个数组然后循环,引用的模块对应数组键值即可
function modular(){
$one = _xst('archive_settings_download_one');
$str = array();
if (!empty($one)) {
foreach ($one as $val) {
$str[$val['mode_name']] = $val['mode_name'] . ' [单列]';
}
}
return $str;
}
CSF::createSection($prefix, array(
'parent' => 'archive_settings',
'title' => '软件模块',
'icon' => 'fa fa-download',
'fields' => array(
array(
'id' => 'mode',
'type' => 'sorter',
'title' => '',
'enabled_title' => '显示模块',
'disabled_title' => '隐藏模块',
'default' => array(
'disabled' => modular(),
),
),
array(
'id' => 'one',
'type' => 'group',
'max' => '50',
'button_title' => '添加模块',
'fields' => array(
array(
'id' => 'mode_name',
'type' => 'text',
'title' => '模块标题:',
),
array(
'id' => 'button',
'type' => 'button_set',
'options' => array(
'cat' => '内容',
'picture' => '图片',
'article' => '文章滚动',
'branch' => '分类滚动',
'tabs' => '分类选项卡',
'ads' => '广告',
),
'default' => 'cat',
),
array(
'id' => 'name',
'type' => 'text',
'title' => '标题:',
),
),
),
),
));
group模块
sorter模块
modular() 调用group模块 输出到 sorter模块的数值
前端如何对得到一个数组然后循环,引用的模块对应数组键值即可