respect-validation/docs/validators/Base.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.2 KiB

Base

  • Base(string $base)

Validate numbers in any base, even with non regular bases.

v::base(2)->isValid('011010001'); // true
v::base(3)->isValid('0120122001'); // true
v::base(8)->isValid('01234567520'); // true
v::base(16)->isValid('012a34f5675c20d'); // true
v::base(2)->isValid('0120122001'); // false

Templates

Base::TEMPLATE_STANDARD

Mode Template
default {{subject}} must be a number in base {{base|raw}}
inverted {{subject}} must not be a number in base {{base|raw}}

Template placeholders

Placeholder Description
base The base passed to the constructor of the validator.
subject The validated input or the custom validator name (if specified).

Categorization

  • Numbers

Changelog

Version Description
0.5.0 Created

See also: