Warning: You are browsing the documentation for version 2.5 which is not maintained anymore.
If some of your projects are still using this version, consider upgrading.
Table of Contents
The Validator is designed to validate objects against constraints. In real life, a constraint could be: "The cake must not be burned". In Symfony, constraints are similar: They are assertions that a condition is true.
The following constraints are natively available in Symfony:
These are the basic constraints: use them to assert very basic things about the value of properties or the return value of methods on your object.