Framework\Route::getRoute() return relative path only if offset isn't 0

This commit is contained in:
mahagr
2018-02-25 17:38:55 -06:00
parent bf16e2e854
commit d5060a2012

View File

@@ -85,7 +85,7 @@ class Route
public function getRoute($offset = 0, $length = null)
{
if ($offset !== 0 || $length !== null) {
return implode('/', $this->getRouteParts($offset, $length));
return ($offset === 0 ? '/' : '') . implode('/', $this->getRouteParts($offset, $length));
}
return '/' . $this->route;