[Html-widget] formfu - better localized error messages

Carl Franks fireartist at gmail.com
Mon Mar 26 10:32:13 GMT 2007


All constraints, filters, etc. have a new localize_args() method,
whose values are passed to loc(), to allow substitution of [_1], [_2],
etc.
(see Locale::Maketext for details)

There are 2 new constraints - MinLength and MaxLength.
These override localize_args() to automatically provide the respective
min() or max() value, to allow 'friendlier' error messages, such as:
    'Must be at least 3 characters long'
and
    'Must not be longer than 5 characters long'

Carl



More information about the Html-widget mailing list