I want to display an image uploaded by my users in twig.
Twig :
<img src="{{ asset(user.photo|raw) }}" />
This exception is thrown :
An exception has been thrown during the rendering of a template ("Warning: Illegal offset type in isset or empty").
I think it's because user.photo is a File field. I tried doing this :
<img src="{{ asset(dossierPhoto ~ user.photo|raw) }}" />
In this example, I don't have an exception but the image is not shown because it's the wrong path. dossierPhoto is the path where stands the image.
I'm using Webpack Encore for asset management but uploaded files are not managed by it.