From 7bc6e3058c600c716c0d427208b201eecdbd70ca Mon Sep 17 00:00:00 2001
From: filippo.bertilotti <filippobertilotti@gmail.com>
Date: Mon, 06 May 2024 11:11:16 +0200
Subject: [PATCH] gestione views utilizzando variabile globale _GET[] (parte 16)

---
 index.php |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/index.php b/index.php
index cde5a61..98326de 100644
--- a/index.php
+++ b/index.php
@@ -1,5 +1,13 @@
 <?php
 
-require "controller.php";
-$controller = new Controller;
-$controller->index();
\ No newline at end of file
+require "src/controllers/products.php";
+$controller = new Products;
+$action = $_GET["action"];
+
+
+if($action === "index") {
+    $controller->index();
+}elseif($action === "show") {
+    $controller->show();
+}
+    
\ No newline at end of file

--
Gitblit v1.8.0