So I am making a form for a customer add. I want to load in the labels and texts seperate, so I can later on add tooltips and helper text easily meaning this:
{{ form_start(form) }}
{{form_label(form.firstname)}}{{ form_widget(form.firstname) }}
{{form_label(form.lastname)}}{{ form_widget(form.lastname) }}
{{form_label(form.email)}}{{ form_widget(form.email) }}
{{ form_end(form) }}
However when i am rendering this and checking it the entire form still gets displayed even fields not loaded in. Anybody knows how this happened or did I make an obvious mistake?
If you don't want to render all element defined in the form you can use the form_end
with the render_rest
with false
value as described in the doc.
As Example:
{# don't render unrendered fields #}
{{ form_end(form, {'render_rest': false}) }}
Remember to render the _token
element if your use it in your form.
Hope this help