respect-validation/docs/validators/BoolVal.md
Henrique Moody 81310cc4d9
Rename namespace Rules to Validators
Since that namespace contains our “validators”, naming it as such makes
much more sense.
2026-01-05 17:36:35 +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 {{subject}} must be a boolean value
inverted {{subject}} must not be a boolean value

Template placeholders

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

Categorization

  • Booleans
  • Types

Changelog

Version Description
1.0.0 Created

See also: