{% block use_class %}
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
-use Drupal\Core\Routing\LinkGeneratorTrait;
-use Drupal\Core\Url;
+use Drupal\Core\Link;
{% endblock %}
{% block class_declaration %}
* @ingroup {{ module }}
*/
class {{ entity_class }}ListBuilder extends EntityListBuilder {% endblock %}
-{% block use_trait %}
- use LinkGeneratorTrait;
-{% endblock %}
{% block class_methods %}
/**
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\{{module}}\Entity\{{ entity_class }} */
$row['id'] = $entity->id();
- $row['name'] = $this->l(
+ $row['name'] = Link::createFromRoute(
$entity->label(),
- new Url(
- 'entity.{{ entity_name }}.edit_form', array(
- '{{ entity_name }}' => $entity->id(),
- )
- )
+ 'entity.{{ entity_name }}.edit_form',
+ ['{{ entity_name }}' => $entity->id()]
);
return $row + parent::buildRow($entity);
}