Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 validation constraint 'Symfony\Component\Validator\Constraints\MaxLength' not found

I am new to Symfony and frameworks so have been following the Symblog tutorial but have become stuck when validating the forms.

Get this error...

FatalErrorException: Error: Class 'Symfony\Component\Validator\Constraints\MaxLength' not found in /Applications/MAMP/htdocs/Portfolio/Symfony/src/Blogger/BlogBundle/Entity/Enquiry.php line 71

Where am I going wrong?

B

like image 247
afield Avatar asked Jul 19 '13 12:07

afield


1 Answers

MaxLength is deprecated since symfony 2.1 use Length with the max option set.

The reference can be found in UPGRADE-2.1.md in the validator section.

like image 174
Nicolai Fröhlich Avatar answered Oct 23 '22 16:10

Nicolai Fröhlich