i also like to use the following syntax:
'pwd' => array(
'between' => array(
'rule' => array('between', PWD_MIN_LENGTH, PWD_MAX_LENGTH),
'message' => array('Your password needs to be between %s and %s
chars long', PWD_MIN_LENGTH, PWD_MAX_LENGTH),
)
),
a little change in the invalidate() function makes it possible to use
i18n here a little bit better. it checks the arguments and if
available uses sprintf() here.
imagine we would have to translate every possible string with the 2
integer values. this way its just one.
is this worth to be considered an improvement for future versions?
combined with my previous post maybe sth like this could be possible
one day:
"Your password needs to be between %s and %s chars long - currently
its just :length chars"
which then uses String::insert() at some point in the script.
the only thing I cannot figure out is how to best provide the data
like current length or the string itself in invalidate().
at last I could't figure out a clean approach.