function JsonRenderer::__construct

Same name in other branches
  1. 9 core/modules/system/tests/modules/common_test/src/Render/MainContent/JsonRenderer.php \Drupal\common_test\Render\MainContent\JsonRenderer::__construct()
  2. 10 core/modules/system/tests/modules/common_test/src/Render/MainContent/JsonRenderer.php \Drupal\common_test\Render\MainContent\JsonRenderer::__construct()
  3. 11.x core/modules/system/tests/modules/common_test/src/Render/MainContent/JsonRenderer.php \Drupal\common_test\Render\MainContent\JsonRenderer::__construct()

Constructs a new JsonRenderer.

Parameters

\Drupal\Core\Controller\TitleResolverInterface $title_resolver: The title resolver.

\Drupal\Core\Render\RendererInterface $renderer: The renderer service.

File

core/modules/system/tests/modules/common_test/src/Render/MainContent/JsonRenderer.php, line 40

Class

JsonRenderer
Default main content renderer for JSON requests.

Namespace

Drupal\common_test\Render\MainContent

Code

public function __construct(TitleResolverInterface $title_resolver, RendererInterface $renderer) {
    $this->titleResolver = $title_resolver;
    $this->renderer = $renderer;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.