validators\NumberValidator validateValue()

validateValue() protected method Validates a value. A validator class can implement this method to support data validation out of the context of a data model. protected array|null validateValue ( $value )$value mixed The data value to be validated. return array|null The error message and the parameters to be inserted into the error message. Null should be returned if the data is valid. throws yii\base\NotSupportedException if the validator does not supporting data validation withou

validators\NumberValidator validateAttribute()

validateAttribute() public method Validates a single attribute. Child classes must implement this method to provide the actual validation logic. public void validateAttribute ( $model, $attribute )$model yii\base\Model The data model to be validated $attribute string The name of the attribute to be validated.

validators\NumberValidator init()

init() public method Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration. public void init ( )

validators\NumberValidator clientValidateAttribute()

clientValidateAttribute() public method Returns the JavaScript needed for performing client-side validation. You may override this method to return the JavaScript validation code if the validator can support client-side validation. The following JavaScript variables are predefined and can be used in the validation code: attribute: an object describing the the attribute being validated. value: the value being validated. messages: an array used to hold the validation error messages for the

validators\NumberValidator $tooSmall

$tooSmall public property User-defined error message used when the value is smaller than $min. public string $tooSmall = null

validators\NumberValidator $tooBig

$tooBig public property User-defined error message used when the value is bigger than $max. public string $tooBig = null

validators\NumberValidator $numberPattern

$numberPattern public property The regular expression for matching numbers. It defaults to a pattern that matches floating numbers with optional exponential part (e.g. -1.23e-10). public string $numberPattern = '/^\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$/'

validators\NumberValidator $min

$min public property Lower limit of the number. Defaults to null, meaning no lower limit. See also $tooSmall for the customized message used when the number is too small. public integer|float $min = null

validators\NumberValidator $max

$max public property Upper limit of the number. Defaults to null, meaning no upper limit. See also $tooBig for the customized message used when the number is too big. public integer|float $max = null

validators\NumberValidator $integerPattern

$integerPattern public property The regular expression for matching integers. public string $integerPattern = '/^\s*[+-]?\d+\s*$/'