Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3924

How to add image in the twig template?

$
0
0

It start getting bit annoying now. My images are inside public/images/ folder. I am trying to add an image to the my TemplatedEmail

In my twig template, I have tried everything I found in the document:

<img src="{{ asset('images/logos/coffee.jpg') }}" alt="Symfony!"/><img src="{{ absolute_url(asset('images/logos/coffee.jpg')) }}" alt="Symfony!"/><img src="{{asset('build/images/1.0e73ff35.jpg')}}" title="my image" alt="My image">

In the email I am getting like this:

Email

I have tried following:

<img src="{{ asset('../../public/images/Tux.png') }}"><img src="{{ asset('images/basketball.jpg') }}" alt="first"/><img style="display: block;" src="{{ asset('images/Tux.png') }}" alt="...">

Can anybody please help me how to add image in the template ?

source

Thank You.


Viewing all articles
Browse latest Browse all 3924

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>