function entity_view_multiple

Returns the render array for the provided entities.

Parameters

array $entities: The entities to be rendered, must be of the same type.

string $view_mode: The view mode that should be used to display the entity.

string $langcode: (optional) For which language the entity should be rendered, defaults to the current content language.

Return value

array A render array for the entities, indexed by the same keys as the entities array passed in $entities.

4 calls to entity_view_multiple()
comment_view_multiple in drupal/core/modules/comment/comment.module
Constructs render array from an array of loaded comments.
EntityRow::pre_render in drupal/core/modules/system/lib/Drupal/system/Plugin/views/row/EntityRow.php
Overrides Drupal\views\Plugin\views\row\RowPluginBase::pre_render().
node_view_multiple in drupal/core/modules/node/node.module
Constructs a drupal_render() style array from an array of loaded nodes.
taxonomy_term_view_multiple in drupal/core/modules/taxonomy/taxonomy.module
Constructs a drupal_render() style array from an array of loaded terms.

File

drupal/core/includes/entity.inc, line 562
Entity API for handling entities like nodes or users.

Code

function entity_view_multiple(array $entities, $view_mode, $langcode = NULL) {
  return entity_render_controller(reset($entities)
    ->entityType())
    ->viewMultiple($entities, $view_mode, $langcode);
}