kai-grassnick / readable-path-bundle
Extends the sonata media bundle with a possibility for readable image paths.
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- sonata-project/media-bundle: >=2.3
This package is not auto-updated.
Last update: 2020-06-12 00:08:29 UTC
README
Add a thumbnail-filter which allows us to use the image name as a readable path
To allow a new type, we have to overwrite the original FormatThumbnail function
Requirements
- Symfony
- SonataAdmin
How to install
- Add path to parameters.yml
sonata.media.thumbnail.format: "KaiGrassnick\ReadablePathBundle\Thumbnail\FormatThumbnail"
- Add
new KaiGrassnick\ReadablePathBundle\KaiGrassnickReadablePathBundle()
toAppKernel.php
- Done! Now we have a new thumbnail format
How to use
$provider = $this->get("sonata.media.provider.image");
$provider->generatePublicUrl($media, 'readable');
License
- MIT
Credits
- Kai Grassnick