I'm trying to work with a loop in a Controller (in Symfony4) to create a form, with different lines
for ($i=1 ; $i<=$nblig ; $i++) { $formBuilder ->add('date'.$i, DateType::class) -> (...) } The form works fine (I can dump it). I need a similar loop, when I try to render that form with Twig :
{% for i in 1..nblig %} {{ form_widget(form.date ~ i)) }}{% endfor %} And I don't know how to concatenate the field name date, with the var i.
Thanks for your help