function comment_view

Generates an array for rendering a comment.

Parameters

Drupal\comment\Comment $comment: The comment object.

$view_mode: View mode, e.g. 'full', 'teaser'...

$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 drupal_render().

5 calls to comment_view()
CommentContentRebuildTest::testCommentRebuild in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentContentRebuildTest.php
Tests the rebuilding of comment's content arrays on calling comment_view().
comment_preview in drupal/core/modules/comment/comment.module
Generates a comment preview.
comment_reply in drupal/core/modules/comment/comment.pages.inc
Form constructor for the comment reply form.
Rss::render in drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php
Render a row object. This usually passes through to a theme template of some form, but not always.
UnpublishByKeywordComment::execute in drupal/core/modules/comment/lib/Drupal/comment/Plugin/Action/UnpublishByKeywordComment.php
Executes the plugin.

File

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

Code

function comment_view(Comment $comment, $view_mode = 'full', $langcode = NULL) {
  return entity_view($comment, $view_mode, $langcode);
}