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
- Symfony
- SonataAdmin
- 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
$provider = $this->get("sonata.media.provider.image");
$provider->generatePublicUrl($media, 'readable');
- MIT
- Kai Grassnick