You are here

public function MiconListBuilder::render in Micon 8

Same name and namespace in other branches
  1. 2.x 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 58

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.', array(
    '@label' => $this->entityType
      ->getPluralLabel(),
  ));
  foreach ($this
    ->load() as $micon) {
    $build['#attached']['library'][] = 'micon/micon.' . $micon
      ->id();
  }
  return $build;
}