i have a lot of sub entities, so i want to add/update them reusing one controller, view. So i need before every form print out list of sub entities already created. Sub entity name is variable
{% form_theme form 'bootstrap_4_horizontal_layout.html.twig' %}
<table class="table">
{% for entity in parentEntity.{{ subEntityName }} %}
<tr>
<td>{{ entity }}</td>
</tr>
{% endfor %}
</table>
{{ form_start(form) }}
{{ form_widget(form) }}
{{ form_end(form) }}
But this is not working, also
~ subEntityName ~
Not works
Cant find any suggestion. Is possible to use variables in twig loop definition