1 {% extends "base/class.php.twig" %}
4 \Drupal\{{module}}\{{ entity_class }}ListBuilder.
7 {% block namespace_class %}
8 namespace Drupal\{{module}};
12 use Drupal\Core\Entity\EntityInterface;
13 use Drupal\Core\Entity\EntityListBuilder;
17 {% block class_declaration %}
19 * Defines a class to build a listing of {{ label }} entities.
21 * @ingroup {{ module }}
23 class {{ entity_class }}ListBuilder extends EntityListBuilder {% endblock %}
24 {% block class_methods %}
29 public function buildHeader() {
30 $header['id'] = $this->t('{{ label }} ID');
31 $header['name'] = $this->t('Name');
32 return $header + parent::buildHeader();
38 public function buildRow(EntityInterface $entity) {
39 /* @var $entity \Drupal\{{module}}\Entity\{{ entity_class }} */
40 $row['id'] = $entity->id();
41 $row['name'] = Link::createFromRoute(
43 'entity.{{ entity_name }}.edit_form',
44 ['{{ entity_name }}' => $entity->id()]
46 return $row + parent::buildRow($entity);