You are here

public function DomainAliasListBuilder::render in Domain Access 8

Builds the entity listing as renderable array for table.html.twig.

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

Overrides EntityListBuilder::render

File

domain_alias/src/DomainAliasListBuilder.php, line 49

Class

DomainAliasListBuilder
User interface for the domain alias overview screen.

Namespace

Drupal\domain_alias

Code

public function render() {
  $build = [
    '#theme' => 'table',
    '#header' => $this
      ->buildHeader(),
    '#rows' => [],
    '#empty' => $this
      ->t('No aliases have been created for this domain.'),
  ];
  foreach ($this
    ->load() as $entity) {
    if ($row = $this
      ->buildRow($entity)) {
      $build['#rows'][$entity
        ->id()] = $row;
    }
  }
  return $build;
}