Add URL parsing.

This commit is contained in:
Tanner Mckenney 2021-02-09 22:42:41 -08:00
parent f8015cadda
commit bc320fab7a

View File

@ -33,4 +33,34 @@ class Request {
{
return $this->url;
}
/**
* Get the Hostname.
*
* @return string
*/
public function getHost(): string
{
return parse_url($this->url, PHP_URL_HOST);
}
/**
* Get the Path.
*
* @return string
*/
public function getPath(): string
{
return parse_url($this->url, PHP_URL_PATH);
}
/**
* Get the Query.
*
* @return string
*/
public function getQuery(): string
{
return parse_url($this->url, PHP_URL_QUERY);
}
}