respect-validation/docs/rules/BoolVal.md
2024-12-09 01:34:50 +01:00

1.3 KiB

BoolVal

  • BoolVal()

Validates if the input results in a boolean value:

v::boolVal()->isValid('on'); // true
v::boolVal()->isValid('off'); // true
v::boolVal()->isValid('yes'); // true
v::boolVal()->isValid('no'); // true
v::boolVal()->isValid(1); // true
v::boolVal()->isValid(0); // true

Templates

BoolVal::TEMPLATE_STANDARD

Mode Template
default {{name}} must be a boolean value
inverted {{name}} must not be a boolean value

Template placeholders

Placeholder Description
name The validated input or the custom validator name (if specified).

Categorization

  • Booleans
  • Types

Changelog

Version Description
1.0.0 Created

See also: