public function FormatterListBuilder::render in Custom Formatters 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/
FormatterListBuilder.php, line 78
Class
- FormatterListBuilder
- Defines a class to build a listing of custom formatter entities.
Namespace
Drupal\custom_formattersCode
public function render() {
$build = parent::render();
$build['table']['#empty'] = $this
->t('There are no @labels yet. Add a @add_link.', [
'@label' => $this->entityType
->getLabel(),
'@add_link' => Link::createFromRoute($this->entityType
->getLabel(), 'custom_formatters.add_page')
->toString(),
]);
return $build;
}