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
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;
}