Same filename and directory in other branches
- 8.9.x core/modules/image/src/ImageStyleListBuilder.php
- 9 core/modules/image/src/ImageStyleListBuilder.php
Namespace
Drupal\image
File
core/modules/image/src/ImageStyleListBuilder.php
View source
<?php
namespace Drupal\image;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Url;
class ImageStyleListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('Style name');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
return $row + parent::buildRow($entity);
}
public function getDefaultOperations(EntityInterface $entity) {
$flush = [
'title' => t('Flush'),
'weight' => 200,
'url' => $entity
->toUrl('flush-form'),
];
return parent::getDefaultOperations($entity) + [
'flush' => $flush,
];
}
public function render() {
$build = parent::render();
$build['table']['#empty'] = $this
->t('There are currently no styles. <a href=":url">Add a new one</a>.', [
':url' => Url::fromRoute('image.style_add')
->toString(),
]);
return $build;
}
}
Classes