interface MainContentRendererInterface in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Render/MainContent/MainContentRendererInterface.php \Drupal\Core\Render\MainContent\MainContentRendererInterface
- 9 core/lib/Drupal/Core/Render/MainContent/MainContentRendererInterface.php \Drupal\Core\Render\MainContent\MainContentRendererInterface
The interface for "main content" (
_controller;
) renderers.
Classes implementing this interface are able to render the main content (as received from controllers) into a response of a certain format (HTML, JSON …) and/or in a certain decorated manner (e.g. in the case of the default HTML main content renderer: with a page display variant applied).
Hierarchy
- interface \Drupal\Core\Render\MainContent\MainContentRendererInterface
Expanded class hierarchy of MainContentRendererInterface
All classes that implement MainContentRendererInterface
2 files declare their use of MainContentRendererInterface
- FormAjaxResponseBuilder.php in core/
lib/ Drupal/ Core/ Form/ FormAjaxResponseBuilder.php - JsonRenderer.php in core/
modules/ system/ tests/ modules/ common_test/ src/ Render/ MainContent/ JsonRenderer.php
File
- core/
lib/ Drupal/ Core/ Render/ MainContent/ MainContentRendererInterface.php, line 16
Namespace
Drupal\Core\Render\MainContentView source
interface MainContentRendererInterface {
/**
* Renders the main content render array into a response.
*
* @param array $main_content
* The render array representing the main content.
* @param \Symfony\Component\HttpFoundation\Request $request
* The request object, for context.
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match, for context.
*
* @return \Symfony\Component\HttpFoundation\Response
* The Response in the format that this implementation supports.
*/
public function renderResponse(array $main_content, Request $request, RouteMatchInterface $route_match);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MainContentRendererInterface:: |
public | function | Renders the main content render array into a response. | 4 |