I'm following the tutorial from (https://symfony.com/doc/master/bundles/EasyAdminBundle/integration/vichuploaderbundle.html)
I was able to upload the image, but it´s not appearing in the list view of easy-admin.
It goes like this:
#easy_admin.yaml
easy_admin:
entities:
Manchete:
class: App\Entity\Manchete
form:
fields:
- titulo
- descricao
- link
- { property: 'arquivoDaImagem', type: 'vich_image', base_path: '%app.path.manchete_images%',
help: 'selecione uma imagem para a manchete',
, label: 'Imagem da manchete', template: 'vich_uploader_image.html.twig' }
# ...
list:
fields:
- titulo
- descricao
- link
- { property: 'imagem', template: 'vich_uploader_image.html.twig' }
# ...
show:
fields:
- titulo
- descricao
- link
- { property: 'imagem', template: 'vich_uploader_image.html.twig' }
Below are the path to upload the file:
#vich_uploader.yalm
vich_uploader:
db_driver: orm
mappings:
manchete_images:
uri_prefix: '%app.path.manchete_images%'
upload_destination: '%kernel.project_dir%/%app.path.manchete_images%'
#services.yaml
parameters:
locale: 'en'
app.path.manchete_images: /uploads/images/manchetes
The file and the images are being uploaded to the folder:
but aren't being displayed inside easy admin view
It´s my first time using Symfony all these related techniques, so I´m a little lost here.
You should put your images under public folder, try this mapping configuration: