Fix the 'attr' configuration in custom forms#103
Open
kr1-ch wants to merge 1 commit intocomur:masterfrom
kr1-ch:patch-1
Open
Fix the 'attr' configuration in custom forms#103kr1-ch wants to merge 1 commit intocomur:masterfrom kr1-ch:patch-1
kr1-ch wants to merge 1 commit intocomur:masterfrom
kr1-ch:patch-1
Conversation
If you define the attr "style" this way: $view->vars['attr'] = array('style' => 'opacity: 0;width: 0; max-width: 0; height: 0; max-height: 0;');
Then the attr options are not available on forms fields where you use the CroppableImageType, for example:
->add('image1', CroppableImageType::class, array(
'attr' => array('class'=>'block1'),
'uploadConfig' => array(
'uploadRoute' => 'comur_api_upload', //optional
'uploadUrl' => $entity->getUploadRootDir(), // required - see explanation below (you can also put just a dir path)
'webDir' => $entity->getUploadDir(), // required - see explanation below (you can also put just a dir path)
'fileExt' => '*.jpg;*.gif;*.png;*.jpeg', //optional
'libraryDir' => null, //optional
'libraryRoute' => 'comur_api_image_library', //optional
'showLibrary' => true, //optional
'saveOriginal' => 'originalImage', //optional
'generateFilename' => true //optional
),
'cropConfig' => array(
'minWidth' => 588,
'minHeight' => 300,
'aspectRatio' => true, //optional
'cropRoute' => 'comur_api_crop', //optional
'forceResize' => false, //optional
'thumbs' => array( //optional
array(
'maxWidth' => 180,
'maxHeight' => 400,
'useAsFieldImage' => true //optional
)
)
)
))
Owner
|
Hi @Kr118218 |
Author
|
Hi @comur, Thank you for the reply. I don't remember if I tested this scenario two years ago. I'll do it. Are you going to update the project again? |
Owner
|
Hi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If you define the style attr this way:
$view->vars['attr'] = array('style' => 'opacity: 0;width: 0; max-width: 0; height: 0; max-height: 0;');Then the attr options are not available on forms fields where you use the CroppableImageType, for example: