antaresproject/core

View on GitHub
src/utils/testing/fixture/resources/views/antares/foundation/form/controls/radio.twig

Summary

Maintainability
Test Coverage
{% if control.useHiddenElement() %}
    <input type='hidden' name='{{ control.getName() }}' value='{{ control.getUncheckedValue() }}'/>
{% endif %}

{% for option in control.getValueOptions() %}
    {% if option is instanceof('Antares\\Form\\Controls\\Elements\\OptGroup') %}
        <legend>{{ option.label }}</legend>

        {% for opt in option.options %}
            {% include 'antares/foundation::form.controls.elements.radio' with {"option": opt, "control": control} only %}
        {% endfor %}
    {% else %}
        {% include 'antares/foundation::form.controls.elements.radio' with {"option": option, "control": control} only %}
    {% endif %}
{% endfor %}