public function Url::__construct

Create a new URL from URL parts

Parameters

string $scheme Scheme of the URL:

string $host Host of the URL:

string $username Username of the URL:

string $password Password of the URL:

int $port Port of the URL:

string $path Path of the URL:

QueryString|array|string $query Query string of the URL:

string $fragment Fragment of the URL:

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Url.php, line 121

Class

Url
Parses and generates URLs based on URL parts. In favor of performance, URL parts are not validated.

Namespace

Guzzle\Http

Code

public function __construct($scheme, $host, $username = null, $password = null, $port = null, $path = null, QueryString $query = null, $fragment = null) {
  $this->scheme = $scheme;
  $this->host = $host;
  $this->port = $port;
  $this->username = $username;
  $this->password = $password;
  $this->fragment = $fragment;
  $this
    ->setQuery($query ?: new QueryString());
  if ($path) {
    $this
      ->setPath($path);
  }
}