You are here

function LinkDelete::render_link in Views (for Drupal 7) 8.3

Same name in this branch
  1. 8.3 lib/Views/node/Plugin/views/field/LinkDelete.php \Views\node\Plugin\views\field\LinkDelete::render_link()
  2. 8.3 lib/Views/comment/Plugin/views/field/LinkDelete.php \Views\comment\Plugin\views\field\LinkDelete::render_link()

Overrides Link::render_link

File

lib/Views/comment/Plugin/views/field/LinkDelete.php, line 29
Definition of Views\comment\Plugin\views\field\LinkDelete.

Class

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

Namespace

Views\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;
}