diff options
author | Jonathan Tschanter <jmtw@tutanota.de> | 2022-01-21 15:13:35 +0100 |
---|---|---|
committer | Jonathan Tschanter <jmtw@tutanota.de> | 2022-01-21 15:13:35 +0100 |
commit | 432bba3dee1d9be25b9626ac45115929a6422961 (patch) | |
tree | 22964fb4b3f55aa1594067af238344f150d4d9ad /src/Controller | |
parent | 2bde1b0660585e16116fbd12c86b53e886b6f3be (diff) |
Add layout based on list entries
Diffstat (limited to 'src/Controller')
-rw-r--r-- | src/Controller/Home.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Controller/Home.php b/src/Controller/Home.php index 7eda5ee..36879e0 100644 --- a/src/Controller/Home.php +++ b/src/Controller/Home.php @@ -30,7 +30,11 @@ class Home public static function dashboard() { - return Template::render('dashboard.twig', []); + $cards = DB::$entityManager->getRepository(Card::class)->findAll(); + $cardOfTheDay = $cards[array_rand($cards)]; + return Template::render('dashboard.twig', [ + 'cardOfTheDay' => $cardOfTheDay, + ]); } } |