{ Foreach $ ServiceInfo como $ v } <div style = "display: inline-block; margin-right: 10px;"> <input type = valor "checkbox" = "{ $ v .service_item}" id = "checkbox- { $ v .id} "{no name =" $ v .id " valor =" $ arr "} verificado {/ in}> <label para =" checkbox- { v $ .id} "> { $ v .service_item} </ label> </ div> { / foreach }
$ ServiceInfo = model ( 'Serviço') -> Ordem ( 'update_time desc') -> select (); $ this -> assign ( 'ServiceInfo', $ ServiceInfo ); $ arr = [1,3 ]; $ this -> assign ( 'arr', $ arr ); regresso vista ();
{in name="vo.id" value="$data"}checked="checked"{/in}