{# _form_radio.html.twig - Template dédié pour les boutons radio #} {% set hasError = field.vars.errors|length > 0 %} {% set isRequired = field.vars.required %}
{% for child in field %}
{{ form_widget(child, { 'attr': (attr|default({})) | merge({ 'class': 'peer absolute opacity-0 w-full h-full top-0 left-0 cursor-pointer z-10', 'data-action': attr is defined and attr['data-action'] is defined ? attr['data-action'] : 'change->live#action', 'data-live-action-param': attr is defined and attr['data-live-action-param'] is defined ? attr['data-live-action-param'] : 'refreshForm' }) }) }}
{% endfor %}
{% if hasError %}
{{ form_errors(field) }}
{% endif %}