summaryrefslogtreecommitdiff
path: root/src/Controller/Home.php
diff options
context:
space:
mode:
authorJonathan Tschanter <jmtw@tutanota.de>2022-01-21 15:13:35 +0100
committerJonathan Tschanter <jmtw@tutanota.de>2022-01-21 15:13:35 +0100
commit432bba3dee1d9be25b9626ac45115929a6422961 (patch)
tree22964fb4b3f55aa1594067af238344f150d4d9ad /src/Controller/Home.php
parent2bde1b0660585e16116fbd12c86b53e886b6f3be (diff)
Add layout based on list entries
Diffstat (limited to 'src/Controller/Home.php')
-rw-r--r--src/Controller/Home.php6
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,
+ ]);
}
}