class EntityLinkDelete

Same name and namespace in other branches
  1. 11.x core/modules/views/src/Plugin/views/field/EntityLinkDelete.php \Drupal\views\Plugin\views\field\EntityLinkDelete
  2. 10 core/modules/views/src/Plugin/views/field/EntityLinkDelete.php \Drupal\views\Plugin\views\field\EntityLinkDelete
  3. 8.9.x core/modules/views/src/Plugin/views/field/EntityLinkDelete.php \Drupal\views\Plugin\views\field\EntityLinkDelete

Field handler to present a link to delete an entity.

Plugin annotation

@ViewsField("entity_link_delete");

Hierarchy

Expanded class hierarchy of EntityLinkDelete

Related topics

File

core/modules/views/src/Plugin/views/field/EntityLinkDelete.php, line 14

Namespace

Drupal\views\Plugin\views\field
View source
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');
  }

}

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