I couldn't make my validation constraints $form->isValid() works. The book name is always valid even if I put a name with length less than 10...
On my AppBundle\Resources\config\validation\book.yml
AppBundle\Entity\Book:
properties:
bookName:
- NotBlank: ~
- Length:
min: 10
neither from the formBuilder
$builder->add('bookName', TextType::class, array(
'constraints' => new Length(array('min' => 10))))
Here is my framework.validation config
framework:
validation: ~
and the default config is
framework:
validation:
enabled: true
enable_annotations: false
Need help please.
Thanks