diff --git a/src/Controller/Admin/CommentCrudController.php b/src/Controller/Admin/CommentCrudController.php new file mode 100644 index 0000000..57db8fa --- /dev/null +++ b/src/Controller/Admin/CommentCrudController.php @@ -0,0 +1,28 @@ +container->get(AdminUrlGenerator::class); + $url = $routeBuilder->setController(ConferenceCrudController::class)->generateUrl(); + + return $this->redirect($url); + + // Option 1. You can make your dashboard redirect to some common page of your backend + // + // $adminUrlGenerator = $this->container->get(AdminUrlGenerator::class); + // return $this->redirect($adminUrlGenerator->setController(OneOfYourCrudController::class)->generateUrl()); + + // Option 2. You can make your dashboard redirect to different pages depending on the user + // + // if ('jane' === $this->getUser()->getUsername()) { + // return $this->redirect('...'); + // } + + // Option 3. You can render some custom template to display a proper dashboard with widgets, etc. + // (tip: it's easier if your template extends from @EasyAdmin/page/content.html.twig) + // + // return $this->render('some/path/my-dashboard.html.twig'); + } + + public function configureDashboard(): Dashboard + { + return Dashboard::new() + ->setTitle('Guestbook'); + } + + public function configureMenuItems(): iterable + { + yield MenuItem::linkToRoute('Back to the website', 'fas fa-home', 'homepage'); + yield MenuItem::linkToCrud('Conferences', 'fas fa-map-marker-alt', Conference::class); + yield MenuItem::linkToCrud('Comments', 'fas fa-comments', Comment::class); + } +} diff --git a/src/Entity/Conference.php b/src/Entity/Conference.php index 72c3176..6e4485a 100644 --- a/src/Entity/Conference.php +++ b/src/Entity/Conference.php @@ -35,6 +35,10 @@ class Conference $this->comments = new ArrayCollection(); } + public function __toString(): string { + return $this->city . ' ' . $this->year; + } + public function getId(): ?int { return $this->id;