Validator
final class Validator
Common validators.
Properties
static | $messages |
Methods
Is a control's value number greater than or equal to the specified minimum?
Is a control's value number less than or equal to the specified maximum?
Count/length validator. Range is array, min and max length pair.
Does the control's value match the regular expression? Case-sensitive to comply with the HTML5 pattern attribute behaviour
Details
at line 54
static HtmlStringable
formatMessage(Rule $rule, bool $withValue = true)
internal |
No description
at line 117
static bool
validateEqual(Control $control, $arg)
Is control's value equal with second parameter?
at line 144
static bool
validateNotEqual(Control $control, $arg)
Is control's value not equal with second parameter?
at line 153
static bool
validateStatic(Control $control, bool $arg)
Returns argument.
at line 162
static bool
validateFilled(BaseControl $control)
Is control filled?
at line 171
static bool
validateBlank(BaseControl $control)
Is control not filled?
at line 180
static bool
validateValid(BaseControl $control)
Is control valid?
at line 189
static bool
validateRange(Control $control, array $range)
Is a control's value number in specified range?
at line 202
static bool
validateMin(Control $control, $minimum)
Is a control's value number greater than or equal to the specified minimum?
at line 211
static bool
validateMax(Control $control, $maximum)
Is a control's value number less than or equal to the specified maximum?
at line 220
static bool
validateLength(Control $control, array|int $range)
Count/length validator. Range is array, min and max length pair.
at line 234
static bool
validateMinLength(Control $control, $length)
Has control's value minimal count/length?
at line 243
static bool
validateMaxLength(Control $control, $length)
Is control's value count/length in limit?
at line 252
static bool
validateSubmitted(SubmitButton $control)
Has been button pressed?
at line 261
static bool
validateEmail(Control $control)
Is control's value valid email address?
at line 270
static bool
validateUrl(Control $control)
Is control's value valid URL?
at line 291
static bool
validatePattern(Control $control, string $pattern, bool $caseInsensitive = false)
Does the control's value match the regular expression? Case-sensitive to comply with the HTML5 pattern attribute behaviour
at line 305
static bool
validatePatternCaseInsensitive(Control $control, string $pattern)
No description
at line 314
static bool
validateNumeric(Control $control)
Is a control's value numeric?
at line 325
static bool
validateInteger(Control $control)
Is a control's value decimal number?
at line 342
static bool
validateFloat(Control $control)
Is a control's value float number?
at line 361
static bool
validateFileSize(UploadControl $control, $limit)
Is file size in limit?
at line 377
static bool
validateMimeType(UploadControl $control, string|array $mimeType)
Has file specified mime type?
at line 394
static bool
validateImage(UploadControl $control)
Is file image?