From a319f3a419790925bed539ba141038c72a83e70f Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 10 Jan 2022 20:29:04 +0100 Subject: Initial commit --- src/Controller/Card.php | 31 +++++++++++++++++++++++++++++++ src/Controller/Home.php | 22 ++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/Controller/Card.php create mode 100644 src/Controller/Home.php (limited to 'src/Controller') diff --git a/src/Controller/Card.php b/src/Controller/Card.php new file mode 100644 index 0000000..39560bb --- /dev/null +++ b/src/Controller/Card.php @@ -0,0 +1,31 @@ +get('meta') as $key => $value) { + $meta = new CardMeta($key, $value); + $card->addMeta($meta); + DB::save($meta); + } + + DB::save($card); + + $response = new RedirectResponse('/'); + + return $response; + } +} + diff --git a/src/Controller/Home.php b/src/Controller/Home.php new file mode 100644 index 0000000..511b89b --- /dev/null +++ b/src/Controller/Home.php @@ -0,0 +1,22 @@ +getRepository(Card::class)->findOneBy([], ['id' => 'DESC']); + echo "
";
+    $c && var_dump(
+      array_map(fn ($item) => [$item->key, $item->value], $c->meta->toArray()),
+    );
+
+    return Template::render('home.twig');
+  }
+}
+
-- 
cgit v1.2.3