umanit / sonata-media-liip-imagine-bridge-bundle
A bridge between LiipImagineBundle and SonataMediaBundle.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.2
- liip/imagine-bundle: ^2.1
- sonata-project/media-bundle: ^3.16
- symfony/framework-bundle: ^4.1
- symfony/options-resolver: ^4.1
- symfony/yaml: ^4.1
- twig/twig: ^2.5
This package is auto-updated.
Last update: 2024-11-12 23:45:54 UTC
README
This bundle is a bridge to use LiipImagineBundle with SonataMediaBundle.
Installation
composer req umanit/sonata-media-liip-imagine-bridge-bundle
Usage
Two twig filters are provided:
image
Use it to display a full img tag.
{{ object.media|image({width: 350, height: 200, alt: object.title, class: 'my-fancy-class'}, 'outbound') }}
You must at least provide the options width
and height
.
media_path
Use this one to only display the path of an image.
<img src="{{ object.media_path|image(350, 200, 'outbound' }}">