OEmbedIframeController
class OEmbedIframeController implements ContainerInjectionInterface (View source)
| internal | This is an internal part of the media system in Drupal core and may be subject to change in minor releases. This class should not be instantiated or extended by external code. |
Controller which renders an oEmbed resource in a bare page (without blocks).
This controller is meant to render untrusted third-party HTML returned by an oEmbed provider in an iframe, so as to mitigate the potential dangers of of displaying third-party markup (i.e., XSS). The HTML returned by this controller should not be trusted, and should never be displayed outside of an iframe.
Properties
| protected ResourceFetcherInterface | $resourceFetcher | The oEmbed resource fetcher service. |
|
| protected UrlResolverInterface | $urlResolver | The oEmbed URL resolver service. |
|
| protected RendererInterface | $renderer | The renderer service. |
|
| protected LoggerInterface | $logger | The logger channel. |
|
| protected IFrameUrlHelper | $iFrameUrlHelper | The iFrame URL helper service. |
Methods
Constructs an OEmbedIframeController instance.
Instantiates a new instance of this class.
Renders an oEmbed resource.
Details
__construct(ResourceFetcherInterface $resource_fetcher, UrlResolverInterface $url_resolver, RendererInterface $renderer, LoggerInterface $logger, IFrameUrlHelper $iframe_url_helper)
Constructs an OEmbedIframeController instance.
static
create(ContainerInterface $container)
Instantiates a new instance of this class.
This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.
Response
render(Request $request)
Renders an oEmbed resource.