You are here

function uri_template in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/guzzlehttp/guzzle/src/functions.php \GuzzleHttp\uri_template()

Expands a URI template

Parameters

string $template URI template:

array $variables Template variables:

Return value

string

File

vendor/guzzlehttp/guzzle/src/functions.php, line 18

Namespace

GuzzleHttp

Code

function uri_template($template, array $variables) {
  if (extension_loaded('uri_template')) {

    // @codeCoverageIgnoreStart
    return \uri_template($template, $variables);

    // @codeCoverageIgnoreEnd
  }
  static $uriTemplate;
  if (!$uriTemplate) {
    $uriTemplate = new UriTemplate();
  }
  return $uriTemplate
    ->expand($template, $variables);
}