diff --git a/README.md b/README.md index cbc7094..5906116 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ Available options for the `ImageType`: - `cancel_button_class` (`string`): class of the button (default: `''`) - `save_button_class` (`string`): class of the button (default: `''`) - `download_uri` (`string`): the path where the image is located (default: `null`, automatically set) -- `download_link` (`bool`): whether the end user should be able to add a remote image by URL or not (default: `true`) +- `download_link` (`bool`): whether the image should be rendered in the form or not (default: `true`) - `file_upload_enabled` (`bool`): whether to enable the file upload widget or not (default: `true`) - `remote_url_enabled` (`bool`): whether to enable the remote url widget or not (default: `true`) - `rotation_enabled` (`bool`): whether to enable the rotation or not (default: `false`) diff --git a/src/Form/Type/ImageType.php b/src/Form/Type/ImageType.php index dd8804c..efd09f5 100644 --- a/src/Form/Type/ImageType.php +++ b/src/Form/Type/ImageType.php @@ -169,7 +169,7 @@ public function buildView(FormView $view, FormInterface $form, array $options): $view->vars['upload_mimetype'] = $options['upload_mimetype']; $view->vars['upload_quality'] = $options['upload_quality']; - if ($options['download_link'] && $downloadUri = $this->generateDownloadUri($form)) { + if ($options['download_link'] && $downloadUri = $options['download_uri'] ?? $this->generateDownloadUri($form)) { $view->vars['download_uri'] = $downloadUri; } }