How to customize the data-prototype attribute in Symfony 2 forms

后端 未结 11 1178
梦如初夏
梦如初夏 2020-12-12 11:35

Since umpteens days, I block on a problem with Symfony 2 and forms.

I got a form of websites entities. \"Websites\" is a collection of website\'s entities and each w

11条回答
  •  误落风尘
    2020-12-12 12:25

    If you do not need to define a template system-wide, simply set a template in your twig template, and ask twig to use it.

    {# using the profiler, you can find the block widget tested by twig #}
    {% block my_block_widget %}
        

    My template for collection

    {{ form_row(form.field1)}}
    {{ form_row(form.field2)}}
    {% endblock %} {% form_theme form.my_collection _self %}

提交回复
热议问题