10 return $this->mParams[
'size'] ?? 20;
14 $p = parent::validate( $value, $alldata );
20 $value = trim( $value ??
'' );
23 # with the addition that a leading '+' sign is ok.
24 if ( !preg_match(
'/^((\+|\-)?\d+(\.\d+)?(E(\+|\-)?\d+)?)?$/i', $value ) ) {
25 return $this->
msg(
'htmlform-float-invalid' );
28 # The "int" part of these message names is rather confusing.
29 # They make equal sense for all numbers.
30 if ( isset( $this->mParams[
'min'] ) ) {
31 $min = $this->mParams[
'min'];
33 if ( $min > $value ) {
34 return $this->
msg(
'htmlform-int-toolow', $min );
38 if ( isset( $this->mParams[
'max'] ) ) {
39 $max = $this->mParams[
'max'];
41 if ( $max < $value ) {
42 return $this->
msg(
'htmlform-int-toohigh', $max );
54 return new OOUI\NumberInputWidget( $params );
A field that will contain a numeric value.
validate( $value, $alldata)
Override this function to add specific validation checks on the field input.
getInputWidget( $params)
to overrideWidget