Back to Validation

Control

docs/validators/Control.md

3.1.12.1 KB
Original Source
<!-- SPDX-License-Identifier: MIT SPDX-FileCopyrightText: (c) Respect Project Contributors SPDX-FileContributor: Alexandre Gomes Gaigalas <[email protected]> SPDX-FileContributor: Danilo Correa <[email protected]> SPDX-FileContributor: Emmerson Siqueira <[email protected]> SPDX-FileContributor: Henrique Moody <[email protected]> -->

Control

  • Control()
  • Control(string ...$additionalChars)

Validates if all of the characters in the provided string, are control characters.

php
v::control()->assert("\n\r\t");
// Validation passes successfully

Templates

Control::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must consist only of control characters
inverted{{subject}} must not consist only of control characters

Control::TEMPLATE_EXTRA

ModeTemplate
default{{subject}} must consist only of control characters or {{additionalChars}}
inverted{{subject}} must not consist only of control characters or {{additionalChars}}

Template placeholders

PlaceholderDescription
additionalCharsAdditional characters that are considered valid.
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Strings

Changelog

VersionDescription
3.0.0Templates changed
2.0.0Renamed from Cntrl to Control
0.5.0Created

See Also