[BUGFIX] Fixed getting current route not always returning current url.

This commit is contained in:
Simon Sessingø
2015-12-12 23:38:48 +01:00
parent c67ab20ddd
commit 4f07f38cf5
+10 -1
View File
@@ -280,9 +280,18 @@ class RouterBase {
throw new \InvalidArgumentException('Invalid type for getParams. Must be array or null');
}
// Return current route if no options has been specified
if($controller === null && $parameters === null && $this->loadedRoute !== null) {
$getParams = (is_array($getParams)) ? array_merge($_GET, $getParams) : $_GET;
return $this->processUrl($this->loadedRoute, null, null, $getParams);
$url = parse_url(Request::getInstance()->getUri());
$url = $url['path'];
if(count($getParams)) {
$url .= '?' . $this->arrayToParams($getParams);
}
return $url;
}
$c = '';