如何使用sfNumberValidator?

发布于 2024-09-08 15:34:25 字数 509 浏览 4 评论 0原文

我有一个问题:我尝试使用 sfNumberValidator,但它不起作用。

这是我的 validator.yml 文件:

methods:
 post: [lib_modele_controle, frequence_controle, intervenant_controle, delai_alert_controle, mode_operatoire_controle]


fillin:
  enabled: true      # Active la repopulation

names:


  delai_alert_controle:
    required: true
    required_msg: Veuillez renseigner le délai d'alert
    class: sfNumberValidator
    param:
     nan_error: saisir un nombre

在我的表单中,输入文本或数字时,不会显示错误

I have a problem : I try to use the sfNumberValidator, but it doesn't work.

This is my validator.yml file :

methods:
 post: [lib_modele_controle, frequence_controle, intervenant_controle, delai_alert_controle, mode_operatoire_controle]


fillin:
  enabled: true      # Active la repopulation

names:


  delai_alert_controle:
    required: true
    required_msg: Veuillez renseigner le délai d'alert
    class: sfNumberValidator
    param:
     nan_error: saisir un nombre

In my form, when text is enter, or a number, the error is not display

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终难愈 2024-09-15 15:34:25

我猜你在 yml 中使用验证时使用的是 symfony 1.0。

你的缩进一致吗?我不确定这是一个问题还是您只是粘贴错误,但有些行缩进了两个,有些行缩进了一个空格。

缩进必须一致。

I'm guessing you work with symfony 1.0 as you use validation in yml.

Is you indentation consistent? I'm not sure if it's a problem or you just pasted it wrong but some lines are indented with two and some with one space.

Indentation has to be consistent.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文