Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AllowedValuesConstraint.php

function AllowedValuesConstraint::__construct

Overrides Choice::__construct

File

core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/AllowedValuesConstraint.php, line 23

Class

AllowedValuesConstraint
Checks for the value being allowed.

Namespace

Drupal\Core\Validation\Plugin\Validation\Constraint

Code

public function __construct(...$args) {
    $this->strict = TRUE;
    $this->minMessage = 'You must select at least %limit choice.|You must select at least %limit choices.';
    $this->maxMessage = 'You must select at most %limit choice.|You must select at most %limit choices.';
    parent::__construct(...$args);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal