织梦前台根据checkbox选择的值,对应输出不同的效果


DedeCms织梦自定义字段为多选checkbox时,前台根据checkbox选择的值,对应输出不同的效果,用runphp解决

 

{dede:field.banben runphp=yes}

$mytag = explode(',',@me);

$result = '';

for($index=0;$index<count($mytag);$index++){

    if($index==2) $result .= "<span class=\"download-num\">$mytag[$index]</span>"; else $result .= "<span class=\"version\">$mytag[$index]</span>";

}

@me = $result;

{/dede:field.banben}