Simple check if form field has errors in Twig template

后端 未结 10 1636
一个人的身影
一个人的身影 2021-01-30 08:11

In Twig template I check if a field has an error like this:

{% if form.points.get(\'errors\') is not empty %}

Is there any method like:

10条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 08:48

    For deeper form customization I do:

    //some twisted divs {{form_label(form.MYFORMINPUT)}} {{form_widget(form.MYFORMINPUT)}}

    Sf2.5

提交回复
热议问题