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
render.main_content_renderer
, then \Drupal\Core\Render\MainContent\MainContentRenderersPass will detect it and use it when appropriate.
Hierarchy
- class \Drupal\Core\EventSubscriber\MainContentViewSubscriber implements EventSubscriberInterface
See also
\Drupal\Core\Render\MainContent\MainContentRendererInterface
\Drupal\Core\Render\MainContentControllerPass
File
- core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php, line 25
Namespace
Drupal\Core\EventSubscriber
Members
Name | Modifiers | Type | Description |
---|---|---|---|
MainContentViewSubscriber::$classResolver | protected | property | The class resolver service. |
MainContentViewSubscriber::$mainContentRenderers | protected | property | The available main content renderer services, keyed per format. |
MainContentViewSubscriber::$routeMatch | protected | property | The current route match. |
MainContentViewSubscriber::getSubscribedEvents | static | function | Returns an array of event names this subscriber wants to listen to. Overrides EventSubscriberInterface::getSubscribedEvents |
MainContentViewSubscriber::onViewRenderArray | public | function | Sets a response given a (main content) render array. |
MainContentViewSubscriber::WRAPPER_FORMAT | constant | URL query attribute to indicate the wrapper used to render a request. | |
MainContentViewSubscriber::__construct | public | function | Constructs a new MainContentViewSubscriber object. |
Please login to continue.