mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 15:02:18 +00:00
Added include param parameter to Url::getAbsoluteUrl method.
This commit is contained in:
@@ -447,9 +447,10 @@ class Url implements JsonSerializable
|
|||||||
/**
|
/**
|
||||||
* Returns the absolute url
|
* Returns the absolute url
|
||||||
*
|
*
|
||||||
|
* @param bool $includeParams
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getAbsoluteUrl(): string
|
public function getAbsoluteUrl($includeParams = true): string
|
||||||
{
|
{
|
||||||
$scheme = $this->scheme !== null ? $this->scheme . '://' : '';
|
$scheme = $this->scheme !== null ? $this->scheme . '://' : '';
|
||||||
$host = $this->host ?? '';
|
$host = $this->host ?? '';
|
||||||
@@ -458,7 +459,7 @@ class Url implements JsonSerializable
|
|||||||
$pass = $this->password !== null ? ':' . $this->password : '';
|
$pass = $this->password !== null ? ':' . $this->password : '';
|
||||||
$pass = ($user || $pass) ? $pass . '@' : '';
|
$pass = ($user || $pass) ? $pass . '@' : '';
|
||||||
|
|
||||||
return $scheme . $user . $pass . $host . $port . $this->getRelativeUrl();
|
return $scheme . $user . $pass . $host . $port . $this->getRelativeUrl($includeParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user