MediaFilterController
class MediaFilterController 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 a preview of the provided text.
Properties
| protected RendererInterface | $renderer | The renderer service. |
|
| protected ContentEntityStorageInterface | $mediaStorage | The media storage. |
|
| protected EntityRepositoryInterface | $entityRepository | The entity repository. |
Methods
Constructs an MediaFilterController instance.
Instantiates a new instance of this class.
Returns a HTML response containing a preview of the text after filtering.
Checks access based on media_embed filter status on the text format.
Details
__construct(RendererInterface $renderer, ContentEntityStorageInterface $media_storage, EntityRepositoryInterface $entity_repository)
Constructs an MediaFilterController 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
preview(Request $request, FilterFormatInterface $filter_format)
Returns a HTML response containing a preview of the text after filtering.
Applies all of the given text format's filters, not just the media_embed
filter, because for example filter_align and filter_caption may apply
to it as well.
static AccessResultInterface
formatUsesMediaEmbedFilter(FilterFormatInterface $filter_format)
Checks access based on media_embed filter status on the text format.