function FileExtensionConstraint::__construct
Attributes
#[HasNamedArguments]
File
-
core/
modules/ file/ src/ Plugin/ Validation/ Constraint/ FileExtensionConstraint.php, line 29
Class
- FileExtensionConstraint
- File extension constraint.
Namespace
Drupal\file\Plugin\Validation\ConstraintCode
public function __construct(mixed $options = NULL, ?string $extensions = NULL, public string $message = 'Only files with the following extensions are allowed: %files-allowed.', ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct($options, $groups, $payload);
$this->extensions = $extensions ?? $this->extensions;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.