This project is no longer maintained and no further public releases are planned.

No further support will be given.

Feel free to fork the git repository.

Strings

These error checks allow various checks suitable for strings, f.e. checking if a string is at least 10 characters long or if a string contains a specific word.

Version added

1.0.0

Example code

validators {
  1.class = Validator\DefaultValidator
  1.config {
    fieldConf {
      name.errorCheck {
         1 = required
         2 = minLength
         2.value = 2
         3 = maxLength
         3.value = 30
      }
      email.errorCheck {
        1 = required
        2 = email
        3 = betweenLength
        3 {
           minValue = 10
           maxValue = 70
        }
      }
    }
  }
}

minLength

Checks if the value of a field has at least the configured length

maxLength

Checks if the value of a field has less than the configured length

betweenLength

Checks if the length of the value of a field is between the configured values

pregMatch

Checks a field value using the configured perl regular expression You can use this check to do existing check your own way or to make checks no built-in error check exists for.

containsAll

Checks if a field contains all of the configured values

containsNone

Checks if a field contains none of the configured values

containsOne

Checks if a field contains at least one of the configured values

containsOnly

Checks if a field contains only the configured values