EntityLinkEdit.php

Same filename and directory in other branches
  1. 9 core/modules/views/src/Plugin/views/field/EntityLinkEdit.php
  2. 10 core/modules/views/src/Plugin/views/field/EntityLinkEdit.php
  3. 11.x core/modules/views/src/Plugin/views/field/EntityLinkEdit.php

Namespace

Drupal\views\Plugin\views\field

File

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

View source
<?php

namespace Drupal\views\Plugin\views\field;

use Drupal\views\ResultRow;

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

}

Classes

Title Deprecated Summary
EntityLinkEdit Field handler to present a link to edit an entity.

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