function LengthConstraint::__construct

File

core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/LengthConstraint.php, line 26

Class

LengthConstraint
Length constraint.

Namespace

Drupal\Core\Validation\Plugin\Validation\Constraint

Code

public function __construct(...$args) {
    $this->maxMessage = 'This value is too long. It should have %limit character or less.|This value is too long. It should have %limit characters or less.';
    $this->minMessage = 'This value is too short. It should have %limit character or more.|This value is too short. It should have %limit characters or more.';
    $this->exactMessage = 'This value should have exactly %limit character.|This value should have exactly %limit characters.';
    parent::__construct(...$args);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.