You are here

protected function NodeTranslationHandler::entityFormTitle in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/node/src/NodeTranslationHandler.php \Drupal\node\NodeTranslationHandler::entityFormTitle()

Returns the title to be used for the entity form page.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity whose form is being altered.

Return value

string|null The label of the entity, or NULL if there is no label defined.

Overrides ContentTranslationHandler::entityFormTitle

File

core/modules/node/src/NodeTranslationHandler.php, line 52

Class

NodeTranslationHandler
Defines the translation handler for nodes.

Namespace

Drupal\node

Code

protected function entityFormTitle(EntityInterface $entity) {
  $type_name = node_get_type_label($entity);
  return t('<em>Edit @type</em> @title', [
    '@type' => $type_name,
    '@title' => $entity
      ->label(),
  ]);
}