public NodeViewController::__construct(EntityManagerInterface $entity_manager, RendererInterface $renderer, AccountInterface $current_user = NULL)
Creates an NodeViewController object.
Parameters
\Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager.
\Drupal\Core\Render\RendererInterface $renderer: The renderer service.
\Drupal\Core\Session\AccountInterface $current_user: The current user. For backwards compatibility this is optional, however this will be removed before Drupal 9.0.0.
Overrides EntityViewController::__construct
File
- core/modules/node/src/Controller/NodeViewController.php, line 35
Class
- NodeViewController
- Defines a controller to render a single node.
Namespace
Drupal\node\Controller
Code
public function __construct(EntityManagerInterface $entity_manager, RendererInterface $renderer, AccountInterface $current_user = NULL) { parent::__construct($entity_manager, $renderer); $this->currentUser = $current_user ? : \Drupal::currentUser(); }
Please login to continue.