/** * Rangle validator: is a control's value number in specified range? * @param TextBase * @param array min and max value pair * @return bool */ public static function validateRange(TextBase $control, $range) { return ($range[0] === NULL || $control->getValue() >= $range[0]) && ($range[1] === NULL || $control->getValue() <= $range[1]); }
/** * Rangle validator: is a control's value number in specified range? * @param TextBase * @param array min and max value pair * @return bool */ public static function validateRange(TextBase $control, $range) { return Validators::isInRange($control->getValue(), $range); }
/** * Is a control's value float number? * @return bool * @internal */ public static function validateFloat(TextBase $control) { $value = self::filterFloat($control->getValue()); if (Validators::isNumeric($value)) { $control->setValue((double) $value); return TRUE; } return FALSE; }
/** * Float validator: is each value of tag of control value float number? * @param TextBase * @return bool */ public static function validateFloat(TextBase $control) { foreach ($control->getValue() as $tag) { if (!Strings::match($tag, '/^-?[0-9]*[.,]?[0-9]+$/')) { return FALSE; } } return TRUE; }
Validators::isNumeric(static::filterFloat($control->getValue()));}static function validateRange(TextBase$control,$range){return Validators::isInRange($control->getValue(),$range);}static
/** * Float validator: is a control's value float number? * @param TextBase * @return bool */ public static function validateFloat(TextBase $control) { return Validators::isNumeric(static::filterFloat($control->getValue())); }