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

Generates an array for rendering a comment.


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().:


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


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