George Irimichuk has already helped you, I want to say that you can use the second option provided in Georgeβs answer, you need to focus on this part of the form topic.
Symfony2 twig create a form based on the selected theme, if you try to add a theme of your form, then it will be fine, other options mean that you just click the problem to another place and this is just a trick. No need to update their full form, just add the form form_row, it will work, can try it.
http://symfony.com/doc/current/cookbook/form/form_form_customization.html#customizing-the-form-row
I used this my project, itβs best that you can send attributes from your form builder and then check them in form_row, which displays your lines in the form and can create the form as you want, as after the validation conditions -
attr => array( 'parent_class' => false)
and you can check this in form_row as
if( form.vars.attr.parent_class is defined )
and can add a condition to the twig.
If you have a problem, since your form has a child form, and twig form_row shows this in an odd way -
I am creating this project and only this so far. It has a student entity combined with various objects, so during form entries such as Profile. I used both Student and Address objects, which I did, I just checked this.
{% if ( not form.children ) or ( form.vars.expanded is defined and form.vars.expanded ) %} <div class="{{ form.vars.attr['parent-div-class'] is defined ? form.vars.attr['parent-div-class'] : 'col-sm-12'}}"> <div class="form-group"> {{ form_label(form) }} {{ form_widget(form) }} {% if form_errors(form) %} {{ form_errors(form) }} {% endif %} </div> </div> {% else %} <div class="clear-both"></div> {{ form_label(form) }} {{ form_widget(form) }} {% endif %}
the code is not like this, but a basic concept.
I hope you understand my point.