symfony/symfony-docs — Issue #909: String contraint with minLength and maxLength
Author: jlvollmer
Created: 2011-12-12 04:09:18+00:00
State: open

In the following documentation:

# src/Acme/BlogBundle/Resources/config/validation.yml
Acme\BlogBundle\Entity\Blog:
properties:
firstName:
- MinLength: { limit: 3, message: "Your name must have at least {{ limit }} characters." }

{{ limit }} will not work as expected. You must use the form:

# src/Acme/BlogBundle/Resources/config/validation.yml
Acme\BlogBundle\Entity\Blog:
properties:
firstName:
- MinLength:
limit: 3
message: Your name must have at least {{ limit }} characters.