I need to set incremented variable in foreach loop. and set incremented variable value as name of my text field, but I've got this error:
Unexpected "i" tag (expecting closing tag for the "for" tag defined near line 44). 500 Internal Server Error - Twig_Error_Syntax
Here is my code:
{% for key, poll_option in poll_options %}
{% set i = '' %}
<input id="option_name" value="{{poll_option.option}}" name="se_pollbundle_polls[name_{{ i }}]" type="text">
{% i++ %}
{% endfor %}