breithbarbot / cropper-bundle Goto Github PK
View Code? Open in Web Editor NEWSimple cropping tool for Symfony
License: MIT License
Simple cropping tool for Symfony
License: MIT License
Any plans for an update not depending on the now deprecated Twig_Extension?
For use with Symfony >=4.4
Hello and thank you for this bundle!
I would like to replace the template "fields.html.twig" but I can't.
I have however created a "bundles" folder with the template inside, maybe I am doing it wrong?
How would you do it?
Thank you very much :)
David
Hello
Thanks for the bundle, however when I try to use it in my symfony4 project I got the error
Unable to find template "BreithbarbotCropperBundle:Form:fields.html.twig" (looked into: /var/www/symfony4/templates, /var/www/symfony4/vendor/symfony/twig-bridge/Resources/views/Form).
and the traceback point my {{ form_start(form) }}
I try removing the line all together and now i got the error at
{% include 'BreithbarbotCropperBundle:Form:cropper_modal.html.twig' with {'mapping': 'user_avatar'} %}
for this one it seems to be because it needs to be rewritten in symfony4 like this
{% include '@BreithbarbotCropper/Form/cropper_modal.html.twig' with {'mapping': 'user_avatar'} %}
Is there any plans regarding Symfony 6 and PHP 8 support?
composer expect php7.4, is ithere a good raison why it don't accept php 8 ? what about an update ?
Hello, i'm trying to use your bundle. I followed the tutorial but when i upload an image i got the following error :
ajouter:250 Uncaught TypeError: $(...).cropper is not a function
at FileReader.reader.onload (ajouter:250)
Thanks
EDIT : I had to include the link to cropper.js in my file too
Hello,
I followed the seven steps in documentation and I have this error when I clear the cache with console.
php bin/console cache:clear --no-warmup
array:2 [
"config" => array:1 [
"default_folder" => "uploads"
]
"mappings" => []
]
In BreithbarbotCropperExtension.php line 36:
Notice: Undefined index: data_class
I tried different solutions and with the example.
The symfony version is 3.4.17.
Thanks you !
Hi there.
Not sure what I'm doing wrong but it seems as if breithbarbot/cropper conflicts with symfony/symfony. I'm getting this:
$ composer req breithbarbot/cropper
Using version ^2.1 for breithbarbot/cropper
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: remove symfony/symfony v3.4.33
- Conclusion: don't install symfony/symfony v3.4.33
- breithbarbot/cropper v2.1.0 conflicts with symfony/symfony[v3.4.33].
- breithbarbot/cropper v2.1.1 conflicts with symfony/symfony[v3.4.33].
- breithbarbot/cropper v2.1.2 conflicts with symfony/symfony[v3.4.33].
- Installation request for symfony/symfony (locked at v3.4.33, required as ^3.4) -> satisfiable by symfony/symfony[v3.4.33].
- Installation request for breithbarbot/cropper ^2.1 -> satisfiable by breithbarbot/cropper[v2.1.0, v2.1.1, v2.1.2].
Installation failed, reverting ./composer.json to its original content.
Hello and thank for your very usefull bundle :)
From Symfony 5, I installed and configured your bundle. All works like a charm when I use only one BreithbarbotCropperType field in a form. But when I want use two BreithbarbotCropperType fields in a same form I get a weird front bug :
Of course I followed the 'Multiple usage instructions' page here https://github.com/breithbarbot/cropper-bundle/blob/master/Resources/doc/usage_multiple.md
My code :
The config/packages/breithbarbot_cropper.yaml
file :
breithbarbot_cropper:
mappings:
article_teaserImage:
routes:
path_add: 'admin_cropper_article_teaserImage'
ratio: '16/9'
article_mainImage:
routes:
path_add: 'admin_cropper_article_mainImage'
ratio: '82/25'
The src/Form/ArticleType,php
file :
$editT = (null !== $builder->getData()->getTeaserImage());
$editM = (null !== $builder->getData()->getMainImage());
$builder
->add('teaserImage', BreithbarbotCropperType::class, [
'mapped' => $editT,
'mapping' => 'article_teaserImage',
'additional_data' => [
'entity_id' => $builder->getData()->getId(), // Get current ID
],
'identifier' => 'crop1',
])
->add('mainImage', BreithbarbotCropperType::class, [
'mapped' => $editM,
'mapping' => 'article_mainImage',
'additional_data' => [
'entity_id' => $builder->getData()->getId(), // Get current ID
],
'identifier' => 'crop2',
])
And the twig template file :
{% include '@BreithbarbotCropper/Form/cropper_modal.html.twig' with {'mapping': 'article_teaserImage','id': 'crop1'} %}
{% include '@BreithbarbotCropper/Form/cropper_modal.html.twig' with {'mapping': 'article_mainImage','id': 'crop2'} %}
{#{{ include('article/_form.html.twig') }}#} {# commented for debugging #}
{{ form_row(form.teaserImage) }}
{{ form_row(form.mainImage) }}
=> In the twig template file, if I comment {{ form_row(form.mainImage) }}
the {{ form_row(form.teaserImage) }}
works perfectly.
=> And vice versa, if I comment {{ form_row(form.teaserImage) }}
the {{ form_row(form.mainImage) }}
works perfectly
And finally, the code of the page
Did I make a mistake somewhere ? Did I find a bundle bug ?
Thanks for your help :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.