Closed
Description
Origin of this ticket: #5714
Currently, it is not possible to write error messages that contain the name of the field that they concern. Technically, that's logical, since the Validator component is not aware of the Form component.
However, it would be quite simple to support "{{ label }}" placeholders (or similar). These could be set by the validator to the field's name by default ("title" in the below example), and overwritten in the Form context by the corresponding field's label:
class Article
{
/**
* @Assert\NotBlank(message="The field {{ label }} should not be blank.")
*/
private $title;
}