From 5c34c1061c1708ba5e4d61ca9442c41e1783eea0 Mon Sep 17 00:00:00 2001 From: Pablo Rodriguez Date: Sun, 28 Jul 2024 02:54:46 -0400 Subject: [PATCH] Comment photo is now showed in admin page --- src/Controller/Admin/CommentCrudController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Controller/Admin/CommentCrudController.php b/src/Controller/Admin/CommentCrudController.php index ffaf3f2..e9fdbaa 100644 --- a/src/Controller/Admin/CommentCrudController.php +++ b/src/Controller/Admin/CommentCrudController.php @@ -10,6 +10,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField; use EasyCorp\Bundle\EasyAdminBundle\Field\EmailField; use EasyCorp\Bundle\EasyAdminBundle\Field\IdField; +use EasyCorp\Bundle\EasyAdminBundle\Field\ImageField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; @@ -46,7 +47,9 @@ class CommentCrudController extends AbstractCrudController yield TextareaField::new('text') ->hideOnIndex() ; - yield TextField::new('photoFilename') + yield ImageField::new('photoFilename') + ->setBasePath('/uploads/photos') + ->setLabel('Photo') ->onlyOnIndex() ;