function NodePreviewController::create

Same name in other branches
  1. 8.9.x core/modules/node/src/Controller/NodePreviewController.php \Drupal\node\Controller\NodePreviewController::create()
  2. 10 core/modules/node/src/Controller/NodePreviewController.php \Drupal\node\Controller\NodePreviewController::create()
  3. 11.x core/modules/node/src/Controller/NodePreviewController.php \Drupal\node\Controller\NodePreviewController::create()

Overrides EntityViewController::create

File

core/modules/node/src/Controller/NodePreviewController.php, line 42

Class

NodePreviewController
Defines a controller to render a single node in preview.

Namespace

Drupal\node\Controller

Code

public static function create(ContainerInterface $container) {
    return new static($container->get('entity_type.manager'), $container->get('renderer'), $container->get('entity.repository'));
}

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