function NodePreviewController::view
Same name in other branches
- 9 core/modules/node/src/Controller/NodePreviewController.php \Drupal\node\Controller\NodePreviewController::view()
- 8.9.x core/modules/node/src/Controller/NodePreviewController.php \Drupal\node\Controller\NodePreviewController::view()
- 10 core/modules/node/src/Controller/NodePreviewController.php \Drupal\node\Controller\NodePreviewController::view()
Overrides EntityViewController::view
1 string reference to 'NodePreviewController::view'
- node.routing.yml in core/
modules/ node/ node.routing.yml - core/modules/node/node.routing.yml
File
-
core/
modules/ node/ src/ Controller/ NodePreviewController.php, line 53
Class
- NodePreviewController
- Defines a controller to render a single node in preview.
Namespace
Drupal\node\ControllerCode
public function view(EntityInterface $node_preview, $view_mode_id = 'full', $langcode = NULL) {
$node_preview->preview_view_mode = $view_mode_id;
$build = parent::view($node_preview, $view_mode_id);
$build['#attached']['library'][] = 'node/drupal.node.preview';
// Don't render cache previews.
unset($build['#cache']);
return $build;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.