function LinkDelete::render_link

Same name in this branch

Overrides Link::render_link

File

drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkDelete.php, line 29
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
    ->get_value($values, 'cid');
  $this->options['alter']['make_link'] = TRUE;
  $this->options['alter']['path'] = "comment/" . $cid . "/delete";
  $this->options['alter']['query'] = drupal_get_destination();
  return $text;
}