class FileImageDimensionsConstraint
Same name and namespace in other branches
- 10 core/modules/file/src/Plugin/Validation/Constraint/FileImageDimensionsConstraint.php \Drupal\file\Plugin\Validation\Constraint\FileImageDimensionsConstraint
- 11.x core/modules/file/src/Plugin/Validation/Constraint/FileImageDimensionsConstraint.php \Drupal\file\Plugin\Validation\Constraint\FileImageDimensionsConstraint
File extension dimensions constraint.
Attributes
#[Constraint(id: 'FileImageDimensions', label: new TranslatableMarkup('File Image Dimensions', [], [
'context' => 'Validation',
]), type: 'file')]
Hierarchy
- class \Drupal\file\Plugin\Validation\Constraint\FileImageDimensionsConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of FileImageDimensionsConstraint
File
-
core/
modules/ file/ src/ Plugin/ Validation/ Constraint/ FileImageDimensionsConstraint.php, line 14
Namespace
Drupal\file\Plugin\Validation\ConstraintView source
class FileImageDimensionsConstraint extends SymfonyConstraint {
public function __construct(public string|int $minDimensions = 0, public string|int $maxDimensions = 0, public string $messageResizedImageTooSmall = 'The resized image is too small. The minimum dimensions are %dimensions pixels and after resizing, the image size will be %widthx%height pixels.', public string $messageImageTooSmall = 'The image is too small. The minimum dimensions are %dimensions pixels and the image size is %widthx%height pixels.', public string $messageResizeFailed = 'The image exceeds the maximum allowed dimensions and an attempt to resize it failed.', ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct(groups: $groups, payload: $payload);
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.