Reputation: 99
I have a number of fields in my FromType file that have name :
//formType.php
for($i=0;$i<N;$i++){
->add('matricola_'.$i, TextType::class, array(
/*....*/
->add('tipologia_'.$i, TextType::class, array(
/*....*/
->add('esame_'.$i, TextType::class, array(
/*....*/
}
I don't understand in twig file how i can write this fields in a for cicle
I try differente way but without any result.
//twig file
{% for i in 0..10%}
<tr>
error <td>{{ form_widget(form.matricola_{{i}}) }}</td>
error <td>{{ form_widget(form.tipologia_{%i%}) }}</td>
error <td>{{ form_widget(form.esame_.i) }}</td>
</tr>
{% endfor %}
Please help me and sorry for my english
Upvotes: 0
Views: 188