- Fixed: set parameters to null when new url is set

This commit is contained in:
Simon Sessingø
2016-11-17 14:20:29 +01:00
parent c59ab12e1a
commit 2db0601e20
+11
View File
@@ -20,6 +20,17 @@ abstract class LoadableRoute extends RouterEntry implements ILoadableRoute {
*/
public function setUrl($url) {
$this->url = '/' . trim($url, '/') . '/';
if(preg_match_all('/' . static::PARAMETERS_REGEX_MATCH . '/is', $this->url, $matches)) {
if (count($matches[1])) {
foreach (array_keys($matches[1]) as $key) {
$this->parameters[$key] = null;
}
}
}
return $this;
}