DedeCMS的checkbox多選字段自定義取值的方法

2020-06-16 02:05:57 來源:互聯(lián)網(wǎng)作者:佚名 人氣: 次閱讀 212 條評論

文章主要介紹了DedeCMS織夢checkbox多選字段自定義取值,下面是通過網(wǎng)絡(luò)收集整理的代碼片段。給大家做個參考。...

  文章主要介紹了DedeCMS織夢checkbox多選字段自定義取值,下面是通過網(wǎng)絡(luò)收集整理的代碼片段。給大家做個參考。

給 dedecms 的 checkbox 多選字段自定義取值方法:

1、首頁/列表頁標(biāo)簽:

[field:字段 runphp=yes]
$arr = explode(',',@me);
$result = '';
for($index=0;$index<count($arr);$index++){
    $result .= "<span class='tag'>$arr[$index]</span>";
}
@me = $result;
[/field:字段]

2、內(nèi)容頁標(biāo)簽:

{dede:field.字段 runphp=yes}
$arr = explode(',',@me);
$result = '';
for($index=0;$index<count($arr);$index++){
    $result .= "<span class='tag'>$arr[$index]</span>";
}
@me = $result;
{/dede:field.字段}

  以上是整理的全部代碼內(nèi)容,希望文章能夠幫你解決所遇到的程序開發(fā)問題。