affichage radio ChoiceType

Par Kylian.D, il y a 1 an


Afficher manuellement les radios d'un ChoiceType

Bonjour, je voudrais savoir s'il y a un moyen d'afficher manuellement les radios d'un ChoiceType car j'aimerai faire une tableau
avec le nom du ChoiceType et les trois radio dans les 3 autres colonnes

<table class"table table-hover"> <thead> <tr> <th>Stipulation</th> <th>Oui</th> <th>Non</th> <th>N/C</th> </tr> </thead> <tbody> <tr> <td>{{ form.contrat.autresstipulation.clause_du_nivellement.vars.label }}</td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </tbody> </table>

J'ai cherché sur la doc symfony mais pas trouvé le moyen si il y en a un.

2 réponses

eltharin, il y a 1 an

tu peux les recup en numérique : {{ form_widget(form.checkboxField.0, {label: ' '}) }}

Kylian.D, il y a 1 an

Super !! Merci ca marche <table class="table table-hover"> <thead> <tr> <th scope="col">Stipulation</th> <th scope="col">Oui</th> <th scope="col">Non</th> <th scope="col">N/C</th> </tr> </thead> <tbody> <tr class="table-primary"> <th scope="row">{{ form.contrat.autresstipulation.clause_du_nivellement.vars.label }}</th> {% for radio in form.contrat.autresstipulation.clause_du_nivellement %} <td>{{ form_widget(radio, {label: ' '}) }}</td> {% endfor %} </tr> </tbody> </table>