public function Client::expandTemplate

Expand a URI template using client configuration data

Parameters

string $template URI template to expand:

array $variables Additional variables to use in the expansion:

Return value

string

Overrides ClientInterface::expandTemplate

2 calls to Client::expandTemplate()
Client::createRequest in drupal/core/vendor/guzzle/http/Guzzle/Http/Client.php
Create and return a new { Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URI can contain the query string as well. Use an array to provide a URI template and…
Client::getBaseUrl in drupal/core/vendor/guzzle/http/Guzzle/Http/Client.php
Get the client's base URL as either an expanded or raw URI template

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Client.php, line 185

Class

Client
HTTP client

Namespace

Guzzle\Http

Code

public function expandTemplate($template, array $variables = null) {
  $expansionVars = $this
    ->getConfig()
    ->getAll();
  if ($variables) {
    $expansionVars = array_merge($expansionVars, $variables);
  }
  return $this
    ->getUriTemplate()
    ->expand($template, $expansionVars);
}