You are here

public function TitleFormatter::canLink in Manage display 8

Returns whether the entity type supports linking.

Return value

bool TRUE if the entity type supports linking.

3 calls to TitleFormatter::canLink()
TitleFormatter::settingsForm in src/Plugin/Field/FieldFormatter/TitleFormatter.php
Returns a form to configure settings for the formatter.
TitleFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/TitleFormatter.php
Returns a short summary for the current formatter settings.
TitleFormatter::viewElements in src/Plugin/Field/FieldFormatter/TitleFormatter.php
Builds a renderable array for a field value.

File

src/Plugin/Field/FieldFormatter/TitleFormatter.php, line 111

Class

TitleFormatter
A field formatter for entity titles.

Namespace

Drupal\manage_display\Plugin\Field\FieldFormatter

Code

public function canLink() {
  $entity_type = \Drupal::entityTypeManager()
    ->getDefinition($this->fieldDefinition
    ->getTargetEntityTypeId());
  return $entity_type
    ->hasLinkTemplate('canonical');
}