Changeset 5984
- Timestamp:
- 02/01/12 18:47:37 (4 months ago)
- Location:
- trunk/core/viewhelper/form/validators
- Files:
-
- 3 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/viewhelper/form/validators/range.php
r5973 r5984 40 40 { 41 41 /** 42 * @var Clansuite_Formelement_Validator_Minlength42 * @var filter var options 43 43 */ 44 private $validator_minlength; 45 46 /** 47 * @var Clansuite_Formelement_Validator_Maxlength 48 */ 49 private $validator_maxlength; 50 51 public function __construct() 52 { 53 $this->validator_minlength = Clansuite_Formelement_Validator_Minlength(); 54 $this->validator_maxlength = Clansuite_Formelement_Validator_Maxlength(); 55 } 44 private $options = array(); 56 45 57 46 /** … … 63 52 public function setRange($minimum_length, $maximum_length) 64 53 { 65 $this-> validator_minlength->setMinlength($minimum_length);66 $this-> validator_maxlength->setMaxlength($maximum_length);54 $this->options['options']['min_range'] = $minimum_length; 55 $this->options['options']['max_range'] = $maximum_length; 67 56 } 68 57 69 58 public function getErrorMessage() 70 59 { 71 $min = $this-> validator_minlength->getMinlength();72 $max = $this-> validator_maxlength->setMaxlength();60 $min = $this->options['options']['min_range'] 61 $max = $this->options['options']['max_range'] 73 62 74 63 return _('The value is outside the range of ' . $min .' <> '. $max .' chars.'); … … 77 66 protected function processValidationLogic($value) 78 67 { 79 if( $this->validator_maxlength->validate($value) === true and $this->validator_minlength->validate($value) === true)68 if(filter_var($value, FILTER_VALIDATE_INT, $this->options) !== FALSE)) 80 69 { 81 70 return true;
Note: See TracChangeset
for help on using the changeset viewer.
