<?php
$options=$this->getOptionarray($name);
if(!$options){
    echo "Pas de options en array";
    $messages['error'][]="Problème avec les options array de ".$name;
    $options=array(); // eviter une erreur
}
foreach($options as $k => $v){
?>
<div class="mb-1">
    <?php
    if($this->isTagmultiple($name)){
        echo "<input type=\"checkbox\" id=\"check_".$name."_".$k."\" name=\"".$name."[]\" value=\"".$k."\" ";

        if(in_array($k,$this->getAsarray($name))){ echo "checked"; }
        echo ">" ;  

    } else {
        echo "<input type=\"checkbox\" id=\"check_".$name."_".$k."\" name=\"".$name."\" value=\"".$k."\ ";
        if($k==$field->value){ echo "checked"; } 
        echo ">" ; 
    }
    ?>
    <label for="check_<?= $name ?>_<?= $k ?>" style="display:inline"><?= $v ?></label>
</div>
<?php
}

