Validator
class Validator (View source)
Traits
Properties
protected bool | $fails | The Fails flag |
|
protected string | $last_message | The last name |
|
protected array | $errors | The errors list |
|
protected array | $inputs | The validation DATA |
|
protected array | $messages | The user messages |
|
protected array | $rules | Define the valid rule list |
Methods
Validator constructor
Set the user custom message
Details
protected void
compileExists(string $key, string $masque)
Compile Exists Rule
[exists:table,column] Check that the contents of a table field exist
protected void
compileNotExists(string $key, string $masque)
Compile Not Exists Rule
[!exists:table,column] Checks that the contents of the field of a table do not exist
protected void
compileUnique(string $key, string $masque)
Compile Unique Rule
[unique:table,column] Check that the contents of the field of a table is a single value
protected void
compileDate(string $key, string $masque)
Compile Date Rule
[date] Check that the field's content is a valid date
protected void
compileDateTime(string $key, string $masque)
Compile Date Time Rule
[datetime] Check that the contents of the field is a valid date time
protected void
compileEmail(string $key, string $masque)
Compile Email Rule
[email] Check that the content of the field is an email
protected void
compileNumber(string $key, string $masque)
Compile Number Rule
[number] Check that the contents of the field is a number
protected void
compileInt(string $key, string $masque)
Compile Int Rule
[int] Check that the contents of the field is an integer number
protected void
compileFloat(string $key, string $masque)
Compile Float Rule
[float] Check that the field content is a float number
protected void
compileRequired(string $key, string $masque)
Compile Required Rule
protected void
compileEmpty(string $key, string $masque)
Compile Empty Rule
protected void
compileAlphaNum(string $key, string $masque)
Compile Alphanum Rule
[alphanum] Check that the field content is an alphanumeric string
protected void
compileIn(string $key, string $masque)
Compile In Rule
[in:(value, ...)] Check that the contents of the field are equal to the defined value
protected void
compileSize(string $key, string $masque)
Compile Size Rule
[size:value] Check that the contents of the field is a number of character equal to the defined value
protected void
compileLower(string $key, string $masque)
Compile Lower Rule
[lower] Check that the content of the field is a string in miniscule
protected void
compileUpper(string $key, string $masque)
Compile Upper Rule
[upper] Check that the contents of the field is a string in uppercase
protected void
compileAlpha(string $key, string $masque)
Compile Alpha Rule
[alpha] Check that the field content is an alpha
protected void
compileMin(string $key, string $masque)
Compile Min Mask
[min:value] Check that the content of the field is a number of minimal character following the defined value
protected void
compileMax(string $key, string $masque)
Compile Max Rule
[max:value] Check that the content of the field is a number of maximum character following the defined value
protected void
compileSame(string $key, string $masque)
Compile Some Rule
[same:value] Check that the field contents are equal to the mask value
protected void
compileRegex(string $key, string $masque)
Compile Regex Rule
[regex] Check that the contents of the field with a regular expression
void
__construct()
Validator constructor
static Validate
make(array $inputs, array $rules, array $messages = [])
Any possible markers.
setCustomMessages(array $messages)
Set the user custom message
Validate
validate(array $inputs, array $rules)
Make validation