public function UriTemplate::expand

Expand the URI template using the supplied variables

Parameters

string $template URI Template to expand:

array $variables Variables to use with the expansion:

Return value

string Returns the expanded template

Overrides UriTemplateInterface::expand

File

drupal/core/vendor/guzzle/parser/Guzzle/Parser/UriTemplate/UriTemplate.php, line 52

Class

UriTemplate
Expands URI templates using an array of variables

Namespace

Guzzle\Parser\UriTemplate

Code

public function expand($template, array $variables) {
  $this->template = $template;
  $this->variables = $variables;

  // Check to ensure that the preg_* function is needed
  if (false === strpos($this->template, '{')) {
    return $this->template;
  }
  return preg_replace_callback(self::$regex, array(
    $this,
    'expandMatch',
  ), $this->template);
}