class MainContentViewSubscriber

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

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.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!EventSubscriber!MainContentViewSubscriber.php/class/MainContentViewSubscriber/8.1.x