<?php 

// array dans le yaml ou en options 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
}
echo "<div class=\"mb-1\">";
if($this->isTagmultiple($name)){
    echo "<select id=\"select_".$name."\" multiple name=\"".$name."[]\">";
    echo "<option value=\"\"> - - - </option>";
    foreach($options as $k => $v){
        echo "<option value=\"".$k."\" ";
        if(in_array($k,$this->getAsarray($name))){ echo "selected"; }
        echo ">".$v."</option>";
    }
    echo "</select>";
} else {
    echo "<select id=\"select_".$name."\" name=\"".$name."\">";
    echo "<option value=\"\"> - - - </option>";
    foreach($options as $k => $v){
        echo "<option value=\"".$k."\" ";
        if($k==$field->value){ echo "selected"; } 
        echo ">".$v."</option>";
    }
    echo "</select>";
}
echo "</div>";
