Validation
This is a validation framework which should help to do basic validations like max length, required etc.
Features
Following Validators are available
Validator | Descriptions |
|---|---|
BIC | Bic code check if it has the right format |
Verifies the email format | |
equals | Compare if two strings are equal. Used for Password check |
lowercase | Checks if the string is lowercase |
max_length | Maximal length a string can have |
max_value | Max value of a double |
min_value | Min value of a double |
one_digit | Must be one digit |
phone | International format of a phone number |
required | Value must be not null and contain some chars |
special_character | Checks if a string contains any special characters |
uppercase | String must be uppercase |
Getting started
This package uses easy_localization for error messages. Consumer can of course override all the translations globally and define custom message per validator.
Usage
This example demonstrates check of the double value. Entered value by user is in this example 50, but max allowed value is 10.
Check the mail
Custom error message
Translations
in order to generate translation files just run