From e65044fe795e2e3cb8765cba1455d261beadedf0 Mon Sep 17 00:00:00 2001 From: tracer Date: Tue, 12 Apr 2022 19:00:58 +0200 Subject: [PATCH] reorganized menu --- src/Controller/Admin/QuotesCrudController.php | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Controller/Admin/QuotesCrudController.php b/src/Controller/Admin/QuotesCrudController.php index b398729..08e42a9 100644 --- a/src/Controller/Admin/QuotesCrudController.php +++ b/src/Controller/Admin/QuotesCrudController.php @@ -13,16 +13,18 @@ use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; */ class QuotesCrudController extends AbstractCrudController { - public static function getEntityFqcn(): string - { - return Quotes::class; - } - - public function configureFields(string $pageName): iterable - { - return [ - IdField::new(propertyName: 'id'), - TextField::new(propertyName: 'quote'), - ]; - } + public static function getEntityFqcn(): string + { + return Quotes::class; + } + + public function configureFields(string $pageName): iterable + { + yield IdField::new(propertyName: 'id') + ->onlyOnIndex(); + yield TextField::new(propertyName: 'quote') + ->onlyOnIndex(); + yield TextEditorField::new(propertyName: 'quote') + ->onlyOnForms(); + } }