ConfigEntityOperations.php in Configuration Views 2.0.x
Same filename and directory in other branches
Namespace
Drupal\config_views\Plugin\views\fieldFile
src/Plugin/views/field/ConfigEntityOperations.phpView source
<?php
namespace Drupal\config_views\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\ResultRow;
/**
* Field handler to display entity label optionally linked to entity page.
*
* @ViewsField("config_entity_operations")
*/
class ConfigEntityOperations extends FieldPluginBase {
/**
* {@inheritdoc}
*/
public function render(ResultRow $values) {
// Doesn't work as there is no alias.
// $value = $this->getValue($values, 'type');.
$entity_type = $values->type;
$entity = $values->entity;
$list_builder = \Drupal::entityTypeManager()
->getListBuilder($entity_type);
return [
'#type' => 'operations',
'#links' => $list_builder
->getOperations($entity),
];
}
}
Classes
Name![]() |
Description |
---|---|
ConfigEntityOperations | Field handler to display entity label optionally linked to entity page. |