-
Notifications
You must be signed in to change notification settings - Fork 0
Field value validators
Jesús Alonso Abad edited this page Jun 19, 2018
·
1 revision
Every field value validator should extend FormValidator::AbstractFieldValueValidator or one of its subclasses.
-
FormValidator::FieldValueValidators::NonEmpty
: Validates that the field has a value. Can optionally receive the following parameters:-
trim_spaces
: If set to1
, will trim the spaces of the value, so only-whitespace values will be considered as empty as well. If omitted, will be set to0
(i.e., allowing spaces-only values)
-
-
FormValidator::FieldValueValidators::IsNumeric
: Validates that the field value is a number. Can optionally receive the following parameters:-
integer_only
: If set to1
, will only accept integer values. If omitted, it's set to0
by default (i.e., accepts decimal values). -
positive_only
: If set to1
, will only accept values greater or equal to zero. If omitted, it's set to0
by default (i.e., accepts negative numbers).
-