reverted last name change, not needed

This commit is contained in:
tracer 2022-10-25 19:29:06 +02:00
parent 48585f14ab
commit 572cc1eb89

View File

@ -107,18 +107,18 @@ class Router
if ($route->getName() == $routeName) {
if ($vars) {
// build route for dynamic routes
$newRoute = $route->getRoute();
$route = $route->getRoute();
// replace placeholder with current values
foreach ($vars as $key => $value) {
$newRoute = str_replace(search: '{' . $key . '}', replace: $value, subject: $route);
$route = str_replace(search: '{' . $key . '}', replace: $value, subject: $route);
}
return $newRoute;
return $route;
} else {
return $route->getRoute();
}
}
}
// no 404, this is reached only if the code is wrong
// no 404, this is reached only if the code is buggy
die("Missing Route: $routeName");
}
}