umanit/sonata-media-liip-imagine-bridge-bundle

A bridge between LiipImagineBundle and SonataMediaBundle.

0.1 2018-10-17 16:01 UTC

This package is auto-updated.

Last update: 2020-05-12 12:31:45 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' }}">