I'm using Symfony 3 and VichUploader. Here's my config:
vich_uploader:
db_driver: orm
mappings:
photo:
uri_prefix: /uploads/photo
upload_destination: %kernel.root_dir%/../web/uploads/photo
Now in my twig template, if I use:
{{ vich_uploader_asset(member.photo, 'imageFile') }}, the uri generated is /uploads/photo/test.jpg
, which doesn't work.
So i'm using {{ asset(vich_uploader_asset(member.photo, 'imageFile')) }}, which generates the right uri: /my_app_folder/web/uploads/photo/test.jpg
Shouldn't the vich_uploader_asset service generate the right uri by itself?
Or do I have to put uri_prefix: /my_app_folder/web/uploads/photo
in the VichUploader config?
I'm pretty sure I'm missing something here.