Answers for "twig foreach select option"

1

twig foreach select option

<select name="country"data-width="100%">
    {% for key,val in form.country.vars.choices %}
        <option value="{{ val.value }}">{{ val.label }}</option>
    {% endfor %}
</select>
Posted by: Guest on October-29-2021

Browse Popular Code Answers by Language