diff --git a/Routes.php b/Routes.php index 5ca562b..dede7f7 100644 --- a/Routes.php +++ b/Routes.php @@ -50,6 +50,9 @@ public function add(string $url = "", callable|string|null $callback = NULL, arr if (str_contains($url, ":")) { $nUrl = preg_replace("/(:[\w\-_]+)/", "([\w\-\_\:]+)", $url); $nUrl = str_replace("/", "\/", $nUrl); + if (!str_contains($nUrl, "-{$m}")) { + $nUrl .= "-{$m}"; + } $nUrl .= "$"; } @@ -97,6 +100,8 @@ public function route(): bool { array_shift($tmpParams); array_shift($paramNames); + dd($this->routes); + $params = []; for ($x = 0; $x < count($paramNames); $x++) { $params[str_replace(":", "", $paramNames[$x][0] ?? "")] = $tmpParams[$x][0] ?? "";