doudiandi6967
2015-10-27 21:29 阅读 47
已采纳

无法显示form_errors

I can't display all form errors with form_errors(form). But I can display them one by one.

Here is my entities with the constraints :

Locale

property "locale" (@Assert\Length) it's a string

LocaleTranslation extends Translation

property "locale" (@Assert\Valid) (it's a ManyToOne with Locale) it's an object

abstract class Translation value (@Assert\NotBlank) it's a string

My form type is based on LocaleTranslation.

This code works :

  {{ form_errors(form.locale.locale) }}
  {{ form_errors(form.value) }}

But not this one :

  {{ form_errors(form) }}

Any idea ?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

相关推荐