You are here

public function PetListBuilder::render in Previewable email templates 8

Same name and namespace in other branches
  1. 8.4 src/Controller/PetListBuilder.php \Drupal\pet\Controller\PetListBuilder::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/Controller/PetListBuilder.php, line 63

Class

PetListBuilder
Class for pet listing page.

Namespace

Drupal\pet\Controller

Code

public function render() {
  $build['description'] = array(
    '#markup' => $this
      ->t('You can manage the settings on the <a href="@adminlink">admin page</a>.', array(
      '@adminlink' => Url::fromRoute('pet.settings')
        ->toString(),
    )),
    '#access' => $this->currentUser
      ->hasPermission('add PET entity') ? TRUE : FALSE,
  );
  $build['table'] = parent::render();
  return $build;
}