3 namespace Drupal\comment\Plugin\views\field;
6 use Drupal\views\Plugin\views\field\LinkBase;
7 use Drupal\views\ResultRow;
10 * Field handler to present a link to reply to a comment.
12 * @ingroup views_field_handlers
14 * @ViewsField("comment_link_reply")
16 class LinkReply extends LinkBase {
21 protected function getUrlInfo(ResultRow $row) {
22 /** @var \Drupal\comment\CommentInterface $comment */
23 $comment = $this->getEntity($row);
24 return Url::fromRoute('comment.reply', [
25 'entity_type' => $comment->getCommentedEntityTypeId(),
26 'entity' => $comment->getCommentedEntityId(),
27 'field_name' => $comment->getFieldName(),
28 'pid' => $comment->id(),
35 protected function getDefaultLabel() {
36 return $this->t('Reply');