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

2 calls to EntityListController::render()
6 methods override EntityListController::render()

File

drupal/core/lib/Drupal/Core/Entity/EntityListController.php, line 177
Contains \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;
}