public function PetListBuilder::render in Previewable email templates 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/
PetListBuilder.php, line 30
Class
- PetListBuilder
- Defines a class to build a listing of Pet entities.
Namespace
Drupal\petCode
public function render() {
if (\Drupal::currentUser()
->hasPermission('administer pet settings')) {
$build['description'] = [
'#markup' => $this
->t('You can manage the settings on the <a href="@url">admin page</a>.', [
'@url' => \Drupal::urlGenerator()
->generateFromRoute('pet.settings'),
]),
];
}
$build['table'] = parent::render();
return $build;
}