diff --git a/src/Controller/HomeController.php b/src/Controller/HomeController.php index d3a4960..a5af7ff 100644 --- a/src/Controller/HomeController.php +++ b/src/Controller/HomeController.php @@ -1,8 +1,10 @@ communityMemberRepository = new CommunityMemberRepository(); + $this->eventRepository = new EventRepository(); } public function isAuthenticationRequired(): bool @@ -39,7 +44,7 @@ class HomeController implements IAuthenticationRequired return new HtmlContent('home', [ 'communities' => $communities, - 'upcomingEvents' => [] + 'upcomingEvents' => iterator_to_array($this->eventRepository->getUpcomingByUser($user, new DateTime(), 3, true, ['community'])) ]); } } diff --git a/views/home.php b/views/home.php index 67a997d..f7db5c3 100644 --- a/views/home.php +++ b/views/home.php @@ -19,7 +19,13 @@

Upcoming events

0): ?> - +

+ getTitle() ?> + + (getCommunity()->getName() ?>) + getStartDate()->format('Y-m-d') ?> – getEndDate()->format('Y-m-d') ?> + +

There is no upcoming event.