DedeCMS的checkbox多选字段自定义取值的方法

2020-06-16 02:05:57 来源:互联网作者:佚名 人气: 次阅读 212 条评论

文章主要介绍了DedeCMS织梦checkbox多选字段自定义取值,下面是通过网络收集整理的代码片段。给大家做个参考。...

  文章主要介绍了DedeCMS织梦checkbox多选字段自定义取值,下面是通过网络收集整理的代码片段。给大家做个参考。

给 dedecms 的 checkbox 多选字段自定义取值方法:

1、首页/列表页标签:

[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、内容页标签:

{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.字段}

  以上是整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。

您可能感兴趣的文章

相关文章