function LinkDelete::render_link

Same name in this branch
  1. 8.x drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkDelete.php \Drupal\node\Plugin\views\field\LinkDelete::render_link()
  2. 8.x drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkDelete.php \Drupal\comment\Plugin\views\field\LinkDelete::render_link()

Overrides Link::render_link

File

drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkDelete.php, line 26
Definition of Drupal\comment\Plugin\views\field\LinkDelete.

Class

LinkDelete
Field handler to present a link to delete a node.

Namespace

Drupal\comment\Plugin\views\field

Code

function render_link($data, $values) {
  $text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
  $cid = $this
    ->getValue($values, 'cid');
  $this->options['alter']['make_link'] = TRUE;
  $this->options['alter']['path'] = "comment/" . $cid . "/delete";
  $this->options['alter']['query'] = drupal_get_destination();
  return $text;
}