Please help me with the principle of form validation in symfony.
I create a field in the form:
public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('name', TextType::class, array( 'label' => 'Наименование' )); } In this case, according to the documentation, the name field will be required by default.
Now, if you go into the source code in the browser and delete required="required" , and leave the field blank, the form will certainly go off successfully, and the most interesting thing is that $form->isValid() will be true . While in essence, this field cannot be null .
/** * @var string * * @ORM\Column(name="name", type="string", length=255) */ private $name; What then is the essence of form validation, if you still have to check all the fields manually? Or am I doing something wrong?