MainContentViewSubscriber
class MainContentViewSubscriber implements EventSubscriberInterface (View source)
View subscriber rendering main content render arrays into responses.
Additional target rendering formats can be defined by adding another service that implements \Drupal\Core\Render\MainContent\MainContentRendererInterface and tagging it as a @code render.main_content_renderer @endcode, then \Drupal\Core\Render\MainContent\MainContentRenderersPass will detect it and use it when appropriate.
Constants
| WRAPPER_FORMAT |
URL query attribute to indicate the wrapper used to render a request. The wrapper format determines how the HTML is wrapped, for example in a modal dialog. |
Properties
| protected ControllerResolverInterface | $classResolver | The class resolver service. |
|
| protected RouteMatchInterface | $routeMatch | The current route match. |
|
| protected array | $mainContentRenderers | The available main content renderer services, keyed per format. |
Methods
Constructs a new MainContentViewSubscriber object.
Sets a response given a (main content) render array.
{@inheritdoc}
Details
__construct(ClassResolverInterface $class_resolver, RouteMatchInterface $route_match, array $main_content_renderers)
Constructs a new MainContentViewSubscriber object.
onViewRenderArray(ViewEvent $event)
Sets a response given a (main content) render array.
static
getSubscribedEvents()
{@inheritdoc}