Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LinkReply.php

function LinkReply::getUrlInfo

Overrides LinkBase::getUrlInfo

File

core/modules/comment/src/Plugin/views/field/LinkReply.php, line 21

Class

LinkReply
Field handler to present a link to reply to a comment.

Namespace

Drupal\comment\Plugin\views\field

Code

protected function getUrlInfo(ResultRow $row) {
    
    /** @var \Drupal\comment\CommentInterface $comment */
    $comment = $this->getEntity($row);
    if (!$comment) {
        return NULL;
    }
    return Url::fromRoute('comment.reply', [
        'entity_type' => $comment->getCommentedEntityTypeId(),
        'entity' => $comment->getCommentedEntityId(),
        'field_name' => $comment->getFieldName(),
        'pid' => $comment->id(),
    ]);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal