function comment_uri

Same name in other branches
  1. 7.x modules/comment/comment.module \comment_uri()
  2. 9 core/modules/comment/comment.module \comment_uri()
  3. 10 core/modules/comment/comment.module \comment_uri()
  4. 11.x core/modules/comment/comment.module \comment_uri()

Entity URI callback.

File

core/modules/comment/comment.module, line 104

Code

function comment_uri(CommentInterface $comment) {
    return new Url('entity.comment.canonical', [
        'comment' => $comment->id(),
    ], [
        'fragment' => 'comment-' . $comment->id(),
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.