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

class, symfony, validation

Solution

`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.

Problem

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

Original source