Issues

ZF-6186: Zend_Validate possibility to tuncate long values for validate messages

Description

It will be nice to truncate very long vaues passed to validator when creating error messages. For example our application permits string input up to 255 characters in length. When validation fails error message always includes full value. It will be useful to provide optional truncate for error messages for very long strings. Let's say if a string is longer then 100 chars, truncate it to 100 chars and place '...' at the end. This will avoid very long messages in UI regarding validation failures. The reason is there is no point most of the time show the full value in case of error. Just need to let them to know what we are talking about and truncate long strings.

Comments

You could attach a filter which does this for you.

But this will affect Zend_Form::getValues().

New feature added with r16052 to incubator. Waiting for acceptance from the dev-team since 13.06.2009.

New feature cored with r16172