You are here

public function MiconListBuilder::render in Micon 2.x

Same name and namespace in other branches
  1. 8 src/MiconListBuilder.php \Drupal\micon\MiconListBuilder::render()

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

src/MiconListBuilder.php, line 56

Class

MiconListBuilder
Provides a listing of Micon entities.

Namespace

Drupal\micon

Code

public function render() {
  $build = parent::render();
  $build['table']['#empty'] = $this
    ->t('There are no @label yet.', [
    '@label' => $this->entityType
      ->getPluralLabel(),
  ]);
  foreach ($this
    ->load() as $micon) {
    $build['#attached']['library'][] = 'micon/micon.' . $micon
      ->id();
  }
  return $build;
}