function Endpoint::buildResourceUrl

Same name and namespace in other branches
  1. 9 core/modules/media/src/OEmbed/Endpoint.php \Drupal\media\OEmbed\Endpoint::buildResourceUrl()
  2. 10 core/modules/media/src/OEmbed/Endpoint.php \Drupal\media\OEmbed\Endpoint::buildResourceUrl()
  3. 11.x 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.