【发布时间】:2015-01-15 11:41:30
【问题描述】:
我尝试在数字字段中插入一个字符串来进行验证,但它不起作用
/**
* @Assert\Length(max = "16")
* @Assert\NotBlank(groups={"specific"},message="Le montant doit etre renseigné")
* @Assert\Type(type="numeric", message="La valeur {{ value }} n'est pas un nombre.")
*
* @var decimal $amount
*
* @ORM\Column(name="amount", type="decimal", length=16, nullable=true)
*/
private $amount;
每次提交表单我都有一个 postgresql 错误:
SQLSTATE[22P02]: Invalid text representation
我期待的是下面的消息
"The value is xxx not a number"
我正在使用带有 php 5.5 的服务器上安装了 INTL 扩展的 symfony 2.4
【问题讨论】:
标签: php symfony symfony-2.4