You are here

public function KeyListBuilder::render in Key 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

src/Controller/KeyListBuilder.php, line 121

Class

KeyListBuilder
Provides a listing of keys.

Namespace

Drupal\key\Controller

Code

public function render() {
  $build = parent::render();
  $build['table']['#empty'] = $this
    ->t('No keys are available. <a href=":link">Add a key</a>.', [
    ':link' => Url::fromRoute('entity.key.add_form')
      ->toString(),
  ]);
  return $build;
}