Hi soolan,
here are some example rules, that are a little bit more complex than just "required".
I hope they are working.
regards
lx
class Product extends DataObject {
...
public function getCMSValidator() {
$rule_Name_required = new NetefxValidatorRuleREQUIRED ("Name", "The name of the product is required.");
$rule_Price_higher_zero = new NetefxValidatorRuleGREATER ("Price", "You need to enter a price higher than 0.", null, "0");
$rule_Date_required = new NetefxValidatorRuleREQUIRED ("Date", "The date is required.");
$rule_Date_in_future = NetefxValidatorRuleFUNCTION("Date", "The date has to be in the future.", null,array('NetefxValidatorLibraryDate', 'DateIsMinDaysAfterToday', array('date' => 'Date', 'min' => 1)));
$validator = new NetefxValidator($rule_Name_required, $rule_Price_higher_zero, $rule_Date_in_future, $rule_Date_required);
return $validator;
}
...
}