Parameters are now correctly passed on to sub-routes

This commit is contained in:
Simon Sessingø
2021-03-29 17:05:45 +02:00
parent b05bbccc28
commit d6d83ac5bd
3 changed files with 33 additions and 0 deletions
+5
View File
@@ -154,16 +154,21 @@ abstract class Route implements IRoute
$groupParameters = $this->getGroup() !== null ? $this->getGroup()->getParameters() : [];
$lastParams = [];
/* Only take matched parameters with name */
foreach ((array)$parameters[1] as $name) {
// Ignore parent parameters
if(isset($groupParameters[$name]) === true) {
$lastParams[$name] = $matches[$name];
continue;
}
$values[$name] = (isset($matches[$name]) === true && $matches[$name] !== '') ? $matches[$name] : null;
}
$values = array_merge($values, $lastParams);
}
$this->originalParameters = $values;