diff options
author | Daniel Weipert <code@drogueronin.de> | 2022-01-27 10:29:07 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2022-01-27 10:29:07 +0100 |
commit | 27a1680fe386db99fd983eba64533091b9451d27 (patch) | |
tree | cb0eb55fb281c9af492b587399f895400ea1c2da /src/Controller | |
parent | 10c86197f1f63e222dfc9e937911e35ab500a208 (diff) |
Add layout to home route
Diffstat (limited to 'src/Controller')
-rw-r--r-- | src/Controller/Home.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Controller/Home.php b/src/Controller/Home.php index 36879e0..ecc209e 100644 --- a/src/Controller/Home.php +++ b/src/Controller/Home.php @@ -11,13 +11,12 @@ class Home public static function index() { $c = DB::$entityManager->getRepository(Card::class)->findOneBy([], ['id' => 'DESC']); - echo "<pre>"; - $c && var_dump( + $debug = $c ? [ array_map(fn ($item) => [$item->key, $item->value], $c->meta->toArray()), array_map(fn ($item) => "<img style='max-width: 100%;max-height:300px;' src='$item->path'> Votes: " . $item->getVotesTotal(), $c->artworks->toArray()), array_map(fn ($item) => $item->value, $c->votes->toArray()), 'Votes: ' . $c->getVotesTotal(), - ); + ] : null; return Template::render('home.twig', [ 'fields' => [ @@ -25,6 +24,7 @@ class Home 'converted mana cost' => 'meta[cmc]', 'is uno reverse' => 'meta[is_uno_reverse]', ], + 'debug' => $debug, ]); } |