YoastSEO_Vendor\GuzzleHttp\Psr7
Uri::withQueryValue() public Yoast 1.0
Creates a new URI with a specific query string value.
Any existing query string values that exactly match the provided key are removed and replaced with the given key value pair.
A value of null will set the query string key without a value, e.g. "key" instead of "key=value".
{} Это метод класса: Uri{}
Хуков нет.
Возвращает
UriInterface.
Использование
$result = Uri::withQueryValue( \YoastSEO_Vendor\Psr\Http\Message\UriInterface $uri, $key, $value );
- $uri(Uriчислоerface) (обязательный)
- URI to use as a base.
- $key(строка) (обязательный)
- Key to set.
- $value(строка/null) (обязательный)
- Value to set
Код Uri::withQueryValue() Uri::withQueryValue Yoast 15.7
public static function withQueryValue(\YoastSEO_Vendor\Psr\Http\Message\UriInterface $uri, $key, $value)
{
$result = self::getFilteredQueryString($uri, [$key]);
$result[] = self::generateQueryString($key, $value);
return $uri->withQuery(\implode('&', $result));
}