summaryrefslogtreecommitdiff
path: root/src/Controller/Home.php
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2022-01-14 18:21:36 +0100
committerDaniel Weipert <code@drogueronin.de>2022-01-14 18:21:36 +0100
commit4cacc94240944ff316104bfd1b5e8e00fad14517 (patch)
tree2559dc3aa121d70bd645ff0a2fe56e1ae0695daa /src/Controller/Home.php
parent9c0893cb65df986b9edf0f48a6d4d2d65f27b8ef (diff)
Add Artworks, Votes and better routing
Diffstat (limited to 'src/Controller/Home.php')
-rw-r--r--src/Controller/Home.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Controller/Home.php b/src/Controller/Home.php
index 511b89b..1c1500c 100644
--- a/src/Controller/Home.php
+++ b/src/Controller/Home.php
@@ -14,9 +14,18 @@ class Home
echo "<pre>";
$c && var_dump(
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(),
);
- return Template::render('home.twig');
+ return Template::render('home.twig', [
+ 'fields' => [
+ 'name' => 'meta[name]',
+ 'converted mana cost' => 'meta[cmc]',
+ 'is uno reverse' => 'meta[is_uno_reverse]',
+ ],
+ ]);
}
}