3 namespace Drupal\Core\Render\MainContent;
5 use Drupal\Core\Routing\RouteMatchInterface;
6 use Symfony\Component\HttpFoundation\Request;
9 * The interface for "main content" (@code _controller @endcode) renderers.
11 * Classes implementing this interface are able to render the main content (as
12 * received from controllers) into a response of a certain format
13 * (HTML, JSON …) and/or in a certain decorated manner (e.g. in the case of the
14 * default HTML main content renderer: with a page display variant applied).
16 interface MainContentRendererInterface {
19 * Renders the main content render array into a response.
21 * @param array $main_content
22 * The render array representing the main content.
23 * @param \Symfony\Component\HttpFoundation\Request $request
24 * The request object, for context.
25 * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
26 * The route match, for context.
28 * @return \Symfony\Component\HttpFoundation\Response
29 * The Response in the format that this implementation supports.
31 public function renderResponse(array $main_content, Request $request, RouteMatchInterface $route_match);