kai-grassnick/readable-path-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Extends the sonata media bundle with a possibility for readable image paths.

1.0.1 2017-10-16 00:23 UTC

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

  1. Add path to parameters.yml sonata.media.thumbnail.format: "KaiGrassnick\ReadablePathBundle\Thumbnail\FormatThumbnail"
  2. Add new KaiGrassnick\ReadablePathBundle\KaiGrassnickReadablePathBundle() to AppKernel.php
  3. 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