Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Endpoint.php

function 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);
}
RSS feed
Powered by Drupal