Using this manual, I added dynamic field to my form. Now, how can I check existence of this field in my template?
{{ form_start(form) }} {{ form_errors(form) }} {% if ??? %} <--------------------------- {{ form_row(form.myDynamicField) }} {% endif %} {{ form_end(form) }}
Advertisement
Answer
What about,
{% if form.myDynamicField is defined %} {{ form_row(form.myDynamicField) }} {% endif %}
You may also need to check if form.myDynamicField
is not null.