comment_view_multiple

comment_view_multiple($comments, $view_mode = 'full', $langcode = NULL)

Constructs render array from an array of loaded comments.

Parameters

\Drupal\comment\CommentInterface[] $comments: An array of comments as returned by entity_load_multiple().

string $view_mode: (optional) View mode; for instance, 'full', 'teaser', etc. Defaults to 'full'.

string $langcode: (optional) A string indicating the language field values are to be shown in. If no language is provided the current content language is used. Defaults to NULL.

Return value

array An array in the format expected by drupal_render().

Deprecated

in Drupal 8.x and will be removed before Drupal 9.0. Use \Drupal::entityManager()->getViewBuilder('comment')->viewMultiple().

See also

drupal_render()

File

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

Code

function comment_view_multiple($comments, $view_mode = 'full', $langcode = NULL) {
  return entity_view_multiple($comments, $view_mode, $langcode);
}
doc_Drupal
2016-10-29 08:51:31
Comments
Leave a Comment

Please login to continue.