EntityLinkDelete.php

Same filename in other branches
  1. 9 core/modules/views/src/Plugin/views/field/EntityLinkDelete.php
  2. 8.9.x core/modules/views/src/Plugin/views/field/EntityLinkDelete.php
  3. 10 core/modules/views/src/Plugin/views/field/EntityLinkDelete.php

Namespace

Drupal\views\Plugin\views\field

File

core/modules/views/src/Plugin/views/field/EntityLinkDelete.php

View source
<?php

namespace Drupal\views\Plugin\views\field;

use Drupal\views\Attribute\ViewsField;
use Drupal\views\ResultRow;

/**
 * Field handler to present a link to delete an entity.
 *
 * @ingroup views_field_handlers
 */
class EntityLinkDelete extends EntityLink {
    
    /**
     * {@inheritdoc}
     */
    protected function getEntityLinkTemplate() {
        return 'delete-form';
    }
    
    /**
     * {@inheritdoc}
     */
    protected function renderLink(ResultRow $row) {
        $this->options['alter']['query'] = $this->getDestinationArray();
        return parent::renderLink($row);
    }
    
    /**
     * {@inheritdoc}
     */
    protected function getDefaultLabel() {
        return $this->t('delete');
    }

}

Classes

Title Deprecated Summary
EntityLinkDelete Field handler to present a link to delete an entity.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.