public function EntityListController::render

Implements Drupal\Core\Entity\EntityListControllerInterface::render().

Builds the entity list as renderable array for theme_table().

@todo Add a link to add a new item to the #empty text.

Overrides EntityListControllerInterface::render

1 method overrides EntityListController::render()
ViewListController::render in drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewListController.php
Overrides Drupal\Core\Entity\EntityListController::render();

File

drupal/core/lib/Drupal/Core/Entity/EntityListController.php, line 149
Definition of Drupal\Core\Entity\EntityListController.

Class

EntityListController
Provides a generic implementation of an entity list controller.

Namespace

Drupal\Core\Entity

Code

public function render() {
  $build = array(
    '#theme' => 'table',
    '#header' => $this
      ->buildHeader(),
    '#rows' => array(),
    '#empty' => t('There is no @label yet.', array(
      '@label' => $this->entityInfo['label'],
    )),
  );
  foreach ($this
    ->load() as $entity) {
    $build['#rows'][$entity
      ->id()] = $this
      ->buildRow($entity);
  }
  return $build;
}