Symfony2.5,Length Validation maxMessage属性显示带有占位符字符串的消息,而不是“”


Symfony2.5, Length Validation maxMessage attribute shows message with placeholder string instead of "max" value

我使用的是Symfony2.5,下面是我在具有Length验证约束的实体中的字段。

/**
     * @var string
     *
     * @Assert'NotBlank(
     *          groups={"registration"},
     *          message = "Field is required"
     * )
     *
     * @Assert'Length(
     *      max = 50,
     *      groups={"registration"},
     *      maxMessage = "Your first name cannot be longer than {{ limit }} characters length"
     * )
     *
     * 
     * @ORM'Column(name="first_name", type="string", length=50)
     */
    protected $firstName;

当我输入超过50个字符时,验证有效,但它显示的信息如下

Your first name cannot be longer than {{ limit }} characters length

我想要的最大值是50,而不是{{limit}}

知道缺了哪一个小零件吗??

提前感谢。

{{ limit }} The lower/max limit–不工作

用途:

{{ max }}   The upper limit
{{ min }}   The lower limit
{{ value }} The current (invalid) value