GroupContentMenuTypeListBuilder.php in Group Content Menu 8
File
src/GroupContentMenuTypeListBuilder.php
View source
<?php
namespace Drupal\group_content_menu;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Url;
class GroupContentMenuTypeListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['title'] = $this
->t('Label');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['title'] = [
'data' => $entity
->label(),
'class' => [
'menu-label',
],
];
return $row + parent::buildRow($entity);
}
public function render() {
$build = parent::render();
$build['table']['#empty'] = $this
->t('No group menu types available. <a href=":link">Add group menu type</a>.', [
':link' => Url::fromRoute('entity.group_content_menu_type.add_form')
->toString(),
]);
return $build;
}
}