node_view

node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL)

Generates an array for rendering the given node.

Parameters

\Drupal\node\NodeInterface $node: A node entity.

$view_mode: (optional) View mode, e.g., 'full', 'teaser', etc. Defaults to 'full.'

$langcode: (optional) A language code to use for rendering. Defaults to NULL which is the global content language of the current request.

Return value

array An array as expected by drupal_render().

File

core/modules/node/node.module, line 780
The core module that allows content to be submitted to the site.

Code

function node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL) {
  return entity_view($node, $view_mode, $langcode);
}
doc_Drupal
2016-10-29 09:32:00
Comments
Leave a Comment

Please login to continue.