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

Breadcrumb

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

function ContactLink::getUrlInfo

Overrides LinkBase::getUrlInfo

1 call to ContactLink::getUrlInfo()
ContactLink::renderLink in core/modules/contact/src/Plugin/views/field/ContactLink.php
Prepares the link to view an entity.

File

core/modules/contact/src/Plugin/views/field/ContactLink.php, line 32

Class

ContactLink
Defines a field that links to the user contact page, if access is permitted.

Namespace

Drupal\contact\Plugin\views\field

Code

protected function getUrlInfo(ResultRow $row) {
    $entity = $this->getEntity($row);
    if (!$entity) {
        return NULL;
    }
    return Url::fromRoute('entity.user.contact_form', [
        'user' => $entity->id(),
    ]);
}

API Navigation

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