开发者

Zend syntax explanation - %value% what does it mean?

I see syntax on http://framework.zend.com/manual/en/zend.validate.writing_validators.html

The case- what does %value% mean and doing?

  protected $_messageTemplates = array(
    self::FLOAT => "'%value%' is not a floating point value"
  );

T开发者_开发技巧hanks


It's a placeholder that will be replaced by the field's value when displaying this error.

If a user enters "ABC" is this field, the error message will be "'ABC' is not a floating point value"

This is like printf's %s placeholders, in a more verbose and easy to use form. Validators can add their own placeholder variables, and it's easier to deal with %value%, %somevar% than with (positional) %1$s, %2$s, particularly for translators.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜