we added some usefull rules.
So NetefxValidator 0.4 can be downloaded now.
1) new rule "ISONEFROM"
if you have a dropdownfield you can define a number of elements which return TRUE if you choose one of them. This can be used for example in DataObjects that are Translatable. So maybe in each language your dropdownfield has one option that should return TRUE. But now you can define a validationrule that contains the IDs for the "good" options of all languages.
2) new rule "ISNOTONEFROM"
Of course its just the opposite of ISONEFROM. If one of these values is selected, the rule returns FALSE.
3) new rule "MINCHARACTERS"
easy to eyplain: if the users fills less than x letters, the validatorrule returns FALSE
$rule_FirstName_MinChar = new NetefxValidatorRule("FirstName", "MINCHARACTERS", array('2'), "Please enter at least two characters");
Note: this can also be done with REGEXP rules, which were already available in 0.3 . But MINCHARACTERS is easier to use.
4) new rule "MAXCHARACTERS"
similar to "MINCHARACTERS"
5) new rule "CHARACTERSBETWEEN"
gives you the possibility to define MIN and MAX in one rule.
$rule_FirstName_CharBetween = new NetefxValidatorRule("FirstName", "CHARACTERSBETWEEN", array('2','20'), "Please enter between 2 and 20 characters");
6) new rule "XOR"
the new XOR rule belongs to the set of rule combinations.
A XOR rule validates, if and only if exactly one of the two rules, which are given as parameter, validates.
7) updated documentation:
- forgotten to mention the rules "DateIsMinDaysAfterToday" and "DateIsMinDaysBeforeToday"
- better example for own validation functions.
so, i am wayting for the first feedback.