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

Builds a structured array representing the comment's content.

The content built for the comment (field values, comments, file attachments or other comment components) will vary depending on the $view_mode parameter.

Parameters

Comment $comment: A 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.

File

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

Code

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