Skip to content

Commit

Permalink
feat: add URI::getRoutePath()
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Feb 10, 2023
1 parent f1559ed commit 49dbcd9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions system/HTTP/URI.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,20 @@ public function getPath(): string
return $this->path ?? '';
}

/**
* Returns the URI path relative to baseURL.
*
* @return string The Route path.
*/
public function getRoutePath(): string
{
if ($this->routePath === null) {
throw new BadMethodCallException('The $routePath is not set.');
}

return $this->routePath;
}

/**
* Retrieve the query string
*/
Expand Down

0 comments on commit 49dbcd9

Please sign in to comment.