eZ\Publish\Core\Repository\URLWildcardService::substitute PHP Method

substitute() private method

Substitutes all placeholders ({\d}) in the given $destinationUrl with the values from the given $values array.
private substitute ( string $destinationUrl, array $values ) : string
$destinationUrl string
$values array
return string
    private function substitute($destinationUrl, array $values)
    {
        preg_match_all('(\\{(\\d+)\\})', $destinationUrl, $matches);
        foreach ($matches[1] as $match) {
            $destinationUrl = str_replace("{{$match}}", $values[$match], $destinationUrl);
        }
        return $destinationUrl;
    }