CustomFilterListBuilder.php in Custom filter 8
File
src/CustomFilterListBuilder.php
View source
<?php
namespace Drupal\customfilter;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Url;
class CustomFilterListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('Filter');
$header['id'] = $this
->t('Machine name');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = \Drupal::l($this
->getLabel($entity), URL::fromRoute('customfilter.rules.list', array(
'customfilter' => $entity
->id(),
)));
$row['id'] = $entity
->id();
return $row + parent::buildRow($entity);
}
}