function ResourceController::getThumbnailWithNoExtension

Same name and namespace in other branches
  1. 10 core/modules/media/tests/modules/media_test_oembed/src/Controller/ResourceController.php \Drupal\media_test_oembed\Controller\ResourceController::getThumbnailWithNoExtension()
  2. 11.x core/modules/media/tests/modules/media_test_oembed/src/Controller/ResourceController.php \Drupal\media_test_oembed\Controller\ResourceController::getThumbnailWithNoExtension()

Returns an example thumbnail file without an extension.

Return value

\Symfony\Component\HttpFoundation\BinaryFileResponse The response.

1 string reference to 'ResourceController::getThumbnailWithNoExtension'
media_test_oembed.routing.yml in core/modules/media/tests/modules/media_test_oembed/media_test_oembed.routing.yml
core/modules/media/tests/modules/media_test_oembed/media_test_oembed.routing.yml

File

core/modules/media/tests/modules/media_test_oembed/src/Controller/ResourceController.php, line 46

Class

ResourceController
Test controller returning oEmbed resources from Media's test fixtures.

Namespace

Drupal\media_test_oembed\Controller

Code

public function getThumbnailWithNoExtension() {
    $response = new BinaryFileResponse('core/misc/druplicon.png');
    $response->headers
        ->set('Content-Type', 'image/png');
    return $response;
}

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