From 27a1680fe386db99fd983eba64533091b9451d27 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 27 Jan 2022 10:29:07 +0100 Subject: Add layout to home route --- src/Controller/Home.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Controller/Home.php') 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 "
";
-    $c && var_dump(
+    $debug = $c ? [
       array_map(fn ($item) => [$item->key, $item->value], $c->meta->toArray()),
       array_map(fn ($item) => " 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,
     ]);
   }
 
-- 
cgit v1.2.3