function EntityController::addTitle

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/Controller/EntityController.php \Drupal\Core\Entity\Controller\EntityController::addTitle()
  2. 8.9.x core/lib/Drupal/Core/Entity/Controller/EntityController.php \Drupal\Core\Entity\Controller\EntityController::addTitle()
  3. 10 core/lib/Drupal/Core/Entity/Controller/EntityController.php \Drupal\Core\Entity\Controller\EntityController::addTitle()

Provides a generic add title callback for an entity type.

Parameters

string $entity_type_id: The entity type ID.

Return value

string The title for the entity add page.

1 call to EntityController::addTitle()
EntityController::addBundleTitle in core/lib/Drupal/Core/Entity/Controller/EntityController.php
Provides a generic add title callback for entities with bundles.

File

core/lib/Drupal/Core/Entity/Controller/EntityController.php, line 219

Class

EntityController
Provides the add-page and title callbacks for entities.

Namespace

Drupal\Core\Entity\Controller

Code

public function addTitle($entity_type_id) {
    $entity_type = $this->entityTypeManager
        ->getDefinition($entity_type_id);
    return $this->t('Add @entity-type', [
        '@entity-type' => $entity_type->getSingularLabel(),
    ]);
}

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