Skip to content

Latest commit

 

History

History
58 lines (52 loc) · 1.56 KB

constraints.rst

File metadata and controls

58 lines (52 loc) · 1.56 KB

Validation Constraints Reference

.. toctree::
   :maxdepth: 1
   :hidden:

   constraints/False
   constraints/True
   constraints/Type
   constraints/Callback
   constraints/Choice
   constraints/Collection
   constraints/Date
   constraints/DateTime
   constraints/Email
   constraints/File
   constraints/Max
   constraints/MaxLength
   constraints/Min
   constraints/MinLength
   constraints/NotBlank
   constraints/NotNull
   constraints/Regex
   constraints/Time
   constraints/Url
   constraints/Valid

The Validator is designed to validate objects against constraints. In real life, a constraint could be: "The cake must not be burned". In Symfony2, constraints are similar: They are assertions that a condition is true.

Supported Constraints

The following constraints are natively available in Symfony2: