Merge pull request #144 from skipperbent/v2

V2
This commit is contained in:
Simon Sessingø
2016-11-17 15:21:32 +02:00
committed by GitHub
+11
View File
@@ -20,6 +20,17 @@ abstract class LoadableRoute extends RouterEntry implements ILoadableRoute {
*/ */
public function setUrl($url) { public function setUrl($url) {
$this->url = '/' . trim($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; return $this;
} }