function EntityViewController::__construct

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/Controller/EntityViewController.php \Drupal\Core\Entity\Controller\EntityViewController::__construct()
  2. 8.9.x core/lib/Drupal/Core/Entity/Controller/EntityViewController.php \Drupal\Core\Entity\Controller\EntityViewController::__construct()
  3. 10 core/lib/Drupal/Core/Entity/Controller/EntityViewController.php \Drupal\Core\Entity\Controller\EntityViewController::__construct()

Creates an EntityViewController object.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

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

2 methods override EntityViewController::__construct()
NodePreviewController::__construct in core/modules/node/src/Controller/NodePreviewController.php
Creates a NodeViewController object.
NodeViewController::__construct in core/modules/node/src/Controller/NodeViewController.php
Creates a NodeViewController object.

File

core/lib/Drupal/Core/Entity/Controller/EntityViewController.php, line 40

Class

EntityViewController
Defines a generic controller to render a single entity.

Namespace

Drupal\Core\Entity\Controller

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer) {
    $this->entityTypeManager = $entity_type_manager;
    $this->renderer = $renderer;
}

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