Skip to content

Commit

Permalink
Fix issue when multiple params in url
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Ilic <[email protected]>
  • Loading branch information
gigili committed Mar 31, 2021
1 parent c45e768 commit 63871e9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 .= "$";
}

Expand Down Expand Up @@ -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] ?? "";
Expand Down

0 comments on commit 63871e9

Please sign in to comment.