Validator
class Validator
Common validators.
Properties
static array | $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 string|IHtmlString
formatMessage(Rule $rule, bool $withValue = true)
internal |
No description
at line 103
static bool
validateEqual(IControl $control, $arg)
Is control's value equal with second parameter?
at line 121
static bool
validateNotEqual(IControl $control, $arg)
Is control's value not equal with second parameter?
at line 130
static bool
validateStatic(IControl $control, bool $arg)
Returns argument.
at line 139
static bool
validateFilled(BaseControl $control)
Is control filled?
at line 148
static bool
validateBlank(BaseControl $control)
Is control not filled?
at line 157
static bool
validateValid(BaseControl $control)
Is control valid?
at line 166
static bool
validateRange(IControl $control, array $range)
Is a control's value number in specified range?
at line 178
static bool
validateMin(IControl $control, $minimum)
Is a control's value number greater than or equal to the specified minimum?
at line 187
static bool
validateMax(IControl $control, $maximum)
Is a control's value number less than or equal to the specified maximum?
at line 197
static bool
validateLength(IControl $control, array|int $range)
Count/length validator. Range is array, min and max length pair.
at line 210
static bool
validateMinLength(IControl $control, $length)
Has control's value minimal count/length?
at line 219
static bool
validateMaxLength(IControl $control, $length)
Is control's value count/length in limit?
at line 228
static bool
validateSubmitted(SubmitButton $control)
Has been button pressed?
at line 237
static bool
validateEmail(IControl $control)
Is control's value valid email address?
at line 246
static bool
validateUrl(IControl $control)
Is control's value valid URL?
at line 265
static bool
validatePattern(IControl $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 278
static bool
validatePatternCaseInsensitive(IControl $control, string $pattern)
No description
at line 287
static bool
validateNumeric(IControl $control)
Is a control's value numeric?
at line 298
static bool
validateInteger(IControl $control)
Is a control's value decimal number?
at line 314
static bool
validateFloat(IControl $control)
Is a control's value float number?
at line 328
static bool
validateFileSize(UploadControl $control, $limit)
Is file size in limit?
at line 343
static bool
validateMimeType(UploadControl $control, string|string[] $mimeType)
Has file specified mime type?
at line 359
static bool
validateImage(UploadControl $control)
Is file image?