You are here

public function VoteTypeListBuilder::render in Voting API 8.3

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/VoteTypeListBuilder.php, line 60

Class

VoteTypeListBuilder
Defines a class to build a listing of vote type entities.

Namespace

Drupal\votingapi

Code

public function render() {
  $build = parent::render();
  $build['table']['#empty'] = $this
    ->t('No vote types available. <a href="@link">Add vote type</a>.', [
    '@link' => Url::fromRoute('votingapi.type_add')
      ->toString(),
  ]);
  return $build;
}