public function Url::setQuery

Set the query part of the URL

Parameters

QueryString|string|array $query Query to set:

Return value

Url

1 call to Url::setQuery()
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 436

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 setQuery($query) {
  if (is_string($query)) {
    $output = null;
    parse_str($query, $output);
    $this->query = new QueryString($output);
  }
  elseif (is_array($query)) {
    $this->query = new QueryString($query);
  }
  elseif ($query instanceof QueryString) {
    $this->query = $query;
  }
  return $this;
}