Answer the question
In order to leave comments, you need to log in
How to display an error message?
Good afternoon! Couldn't figure out how to simply display an error when validating a form? Please tell me
there is a form
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('name', TextType::class, [
'constraints' => [
new NotBlank(),
new Length(
[
'min' => 2,
'max' => 255,
]
),
],
]);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question