From fc5ee7f51fda1855c792fbedba17021aa982ce3f Mon Sep 17 00:00:00 2001
From: filippo.bertilotti <filippobertilotti@gmail.com>
Date: Tue, 21 May 2024 12:08:43 +0200
Subject: [PATCH] aggiunto codice per aggiungere dati al database tramite il form precedentemente creato (parte 124)

---
 src/App/Controllers/products.php |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/App/Controllers/products.php b/src/App/Controllers/products.php
index 46974e6..fa9253f 100644
--- a/src/App/Controllers/products.php
+++ b/src/App/Controllers/products.php
@@ -36,4 +36,13 @@
         ]);
         echo $this->viewer->render("Products/new.php");
     }
+
+    public function create() {
+        $data = [
+            "name" => $_POST["name"],
+            "description" => $_POST["description"]
+        ];
+
+        var_dump($this->model->insert($data));
+    }
 }
\ No newline at end of file

--
Gitblit v1.8.0