Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Uri.php

function Uri::generateQueryString

2 calls to Uri::generateQueryString()
Uri::withQueryValue in vendor/guzzlehttp/psr7/src/Uri.php
Creates a new URI with a specific query string value.
Uri::withQueryValues in vendor/guzzlehttp/psr7/src/Uri.php
Creates a new URI with multiple specific query string values.

File

vendor/guzzlehttp/psr7/src/Uri.php, line 662

Class

Uri
PSR-7 URI implementation.

Namespace

GuzzleHttp\Psr7

Code

private static function generateQueryString(string $key, ?string $value) : string {
    // Query string separators ("=", "&") within the key or value need to be encoded
    // (while preventing double-encoding) before setting the query string. All other
    // chars that need percent-encoding will be encoded by withQuery().
    $queryString = strtr($key, self::QUERY_SEPARATORS_REPLACEMENT);
    if ($value !== null) {
        $queryString .= '=' . strtr($value, self::QUERY_SEPARATORS_REPLACEMENT);
    }
    return $queryString;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal