public function Url::setPath

Set the path part of the URL

Parameters

array|string $path Path string or array of path segments:

Return value

Url

2 calls to Url::setPath()
Url::addPath in drupal/core/vendor/guzzle/http/Guzzle/Http/Url.php
Add a relative path to the currently set path
Url::__construct in drupal/core/vendor/guzzle/http/Guzzle/Http/Url.php
Create a new URL from URL parts

File

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

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 setPath($path) {
  if (is_array($path)) {
    $this->path = '/' . implode('/', $path);
  }
  else {
    if (substr($path, 0, 1) != '/' && $path != '*') {
      $path = '/' . $path;
    }
    $this->path = $path;
  }
  return $this;
}