From e2903b7b32aa672c9d821b0b18d26c20db5b00f4 Mon Sep 17 00:00:00 2001
From: filippo.bertilotti <filippobertilotti@gmail.com>
Date: Fri, 10 May 2024 09:45:32 +0200
Subject: [PATCH] correzione regular expression per permettere di accettare tutti i caratteri tranne "/" (parte 58)

---
 index.php |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/index.php b/index.php
index 6a9577d..dbfa428 100644
--- a/index.php
+++ b/index.php
@@ -8,6 +8,9 @@
 $segments = explode("/", $path);
 
 $router = new Framework\Router;
+
+$router->add("/{controller}/{action}");
+$router->add("/{controller}/{id}/{action}");
 $router->add("/home/index", ["controller" => "home", "action" => "index"]);
 $router->add("/products", ["controller" => "products", "action" => "index"]);
 $router->add("/", ["controller" => "home", "action" => "index"]);
@@ -15,6 +18,8 @@
 
 $params = $router->match($path);
 
+print_r($params);
+
 if($params === false) {
     exit("No routes matched");
 }

--
Gitblit v1.8.0