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