3 namespace Drupal\entity_browser\Plugin\EntityBrowser\FieldWidgetDisplay;
5 use Drupal\Core\Entity\EntityInterface;
6 use Drupal\entity_browser\FieldWidgetDisplayBase;
9 * Displays a label of the entity.
11 * @EntityBrowserFieldWidgetDisplay(
13 * label = @Translation("Entity label"),
14 * description = @Translation("Displays entity with a label.")
17 class EntityLabel extends FieldWidgetDisplayBase {
22 public function view(EntityInterface $entity) {
23 return $entity->label();