I want to render dynamicly a form in Symfony. I passing a array with elements of element names to the render method 'formElements' => array('formelement1', 'formelement2').
How i want to use the element names in my template to show the form labels.
{% for elementName in elementNames %}
<div class="form-lable">
{{ form_label({{ elementName }}) }}
</div>
{% endfor %}
I received the following exception:
A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "punctuation" of value "{" in onBillBundle:Customer:new.html.twig at line 17
Is it not posible to render the form dynamicly without {{ form(delete_form) }}?