You are here

public function Endpoint::buildResourceUrl in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/media/src/OEmbed/Endpoint.php \Drupal\media\OEmbed\Endpoint::buildResourceUrl()

Builds and returns the endpoint URL.

In most situations this function should not be used. Your are probably looking for \Drupal\media\OEmbed\UrlResolver::getResourceUrl(), because it is alterable and also cached.

Parameters

string $url: The canonical media URL.

Return value

string URL of the oEmbed endpoint.

See also

\Drupal\media\OEmbed\UrlResolver::getResourceUrl()

File

core/modules/media/src/OEmbed/Endpoint.php, line 177

Class

Endpoint
Value object for oEmbed provider endpoints.

Namespace

Drupal\media\OEmbed

Code

public function buildResourceUrl($url) {
  $query = [
    'url' => $url,
  ];
  return $this
    ->getUrl() . '?' . UrlHelper::buildQuery($query);
}