public function Comment::permalink

Returns the permalink URL for this comment.

Return value

array An array containing the 'path' and 'options' keys used to build the URI of the comment, and matching the signature of UrlGenerator::generateFromPath().

Overrides CommentInterface::permalink

File

drupal/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php, line 230
Definition of Drupal\comment\Plugin\Core\Entity\Comment.

Class

Comment
Defines the comment entity class.

Namespace

Drupal\comment\Plugin\Core\Entity

Code

public function permalink() {
  $url['path'] = 'node/' . $this->nid->value;
  $url['options'] = array(
    'fragment' => 'comment-' . $this
      ->id(),
  );
  return $url;
}