vendor/easycorp/easyadmin-bundle/src/Resources/views/crud/field/image.html.twig line 1

Open in your IDE?
  1. {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
  2. {# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #}
  3. {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
  4. {% set images = field.formattedValue %}
  5. {% if images is not iterable %}
  6.     {% set images = [images] %}
  7. {% endif %}
  8. {% for image in images %}
  9.     {% set html_id = 'ea-lightbox-' ~ field.uniqueId ~ '-' ~ loop.index %}
  10.     <a href="#" class="ea-lightbox-thumbnail" data-ea-lightbox-content-selector="#{{ html_id }}">
  11.         <img src="{{ asset(image) }}" class="img-fluid">
  12.     </a>
  13.     <div id="{{ html_id }}" class="ea-lightbox">
  14.         <img src="{{ asset(image) }}">
  15.     </div>
  16. {% endfor %}