Closed delyriand closed 1 year ago
For example, I want to define a custom maxSize in the Image constraint:
->add('image', ImageType::class, [ 'label' => 'app.form.image', 'constraints' => [ new Assert\Image(['maxSize' => '2M']), ], ])
And add the event listener with this code:
$options['constraints'] = RichEditorConstraints::getImageConstraints( $data, 'image', $options['required'] ?? true, $options['constraints'] ?? [] );
For example, I want to define a custom maxSize in the Image constraint:
And add the event listener with this code: