标签:info key model 判断 check input word span div
{foreach $serviceInfo as $v} <div style="display: inline-block;margin-right: 10px;"> <input type="checkbox" value="{$v.service_item}" id="checkbox-{$v.id}" {in name="$v.id"value="$arr" } checked {/in}> <label for="checkbox-{$v.id}">{$v.service_item}</label> </div> {/foreach}
$serviceInfo = model(‘Service‘)->order(‘update_time desc‘)->select(); $this->assign(‘serviceInfo‘, $serviceInfo); $arr = [1,3]; $this->assign(‘arr‘, $arr); return view();
{in name="vo.id" value="$data"}checked="checked"{/in}
tp5 view模板中 判断一个值是否在某个数组内 复选框用到了
标签:info key model 判断 check input word span div
原文地址:https://www.cnblogs.com/zhangcheng001/p/12588141.html