for me, skler's answer is not a solution, because it adds the class to the input, and not to the div.
edit:
The best decision
{% for child in form.children|keys %}
<div class="login_field">
{% if 'token' not in form_label(attribute(form.children,child)) %}
{{form_label(attribute(form.children,child)) }}
{% endif %}
{{form_widget(attribute(form.children,child)) }}
</div>
<br/>
{% endfor %}
lead to:
<div class="registration_field">
<label>e-mail</label>
<input type="email">
</div>
it removes unused divs and token labels, and we can use the .registration_field selector instead of .registration_field> div
for Amstell: I respond to the skler solution, saying that for me this is not a solution, Sorry, this is not clear.
source
share