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

后端 未结 11 1182
梦如初夏
梦如初夏 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:19

    You probably have found out since but here is the solution for others.

    Create a new template and copy/paste this code in it: https://gist.github.com/1294186

    Then in the template containing the form you want to customise, apply it to your form by doing this:

    {% form_theme form 'YourBundle:Deal:Theme/_field-prototype.html.twig' %}
    

提交回复
热议问题