1 comment.module comment_view(Comment $comment, Node $node, $view_mode = 'full', $langcode = NULL)

Generates an array for rendering a comment.

Parameters

Comment $comment: The comment object.

Node $node: The node the comment is attached to.

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

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

Return value

An array as expected by backdrop_render().:

File

core/modules/comment/comment.module, line 942
Enables users to comment on published content.

Code

function comment_view(Comment $comment, Node $node, $view_mode = 'full', $langcode = NULL) {
  return $comment->view($view_mode, $langcode);
}