function UrlResolver::getResourceUrl

Same name in this branch
  1. 8.9.x core/modules/media/src/OEmbed/UrlResolver.php \Drupal\media\OEmbed\UrlResolver::getResourceUrl()
Same name in other branches
  1. 9 core/modules/media/src/OEmbed/UrlResolver.php \Drupal\media\OEmbed\UrlResolver::getResourceUrl()
  2. 9 core/modules/media/tests/modules/media_test_oembed/src/UrlResolver.php \Drupal\media_test_oembed\UrlResolver::getResourceUrl()
  3. 10 core/modules/media/src/OEmbed/UrlResolver.php \Drupal\media\OEmbed\UrlResolver::getResourceUrl()
  4. 10 core/modules/media/tests/modules/media_test_oembed/src/UrlResolver.php \Drupal\media_test_oembed\UrlResolver::getResourceUrl()
  5. 11.x core/modules/media/src/OEmbed/UrlResolver.php \Drupal\media\OEmbed\UrlResolver::getResourceUrl()
  6. 11.x core/modules/media/tests/modules/media_test_oembed/src/UrlResolver.php \Drupal\media_test_oembed\UrlResolver::getResourceUrl()

Overrides UrlResolver::getResourceUrl

File

core/modules/media/tests/modules/media_test_oembed/src/UrlResolver.php, line 29

Class

UrlResolver
Overrides the oEmbed URL resolver service for testing purposes.

Namespace

Drupal\media_test_oembed

Code

public function getResourceUrl($url, $max_width = NULL, $max_height = NULL) {
    $urls = \Drupal::state()->get(static::class, []);
    if (isset($urls[$url])) {
        return $urls[$url];
    }
    return parent::getResourceUrl($url, $max_width, $max_height);
}

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