public function ListUsageController::getTitle in Entity Usage 8
Same name and namespace in other branches
- 8.4 src/Controller/ListUsageController.php \Drupal\entity_usage\Controller\ListUsageController::getTitle()
- 8.2 src/Controller/ListUsageController.php \Drupal\entity_usage\Controller\ListUsageController::getTitle()
- 8.3 src/Controller/ListUsageController.php \Drupal\entity_usage\Controller\ListUsageController::getTitle()
Title page callback.
Parameters
string $type: The entity type.
int $id: The entity id.
Return value
string The title to be used on this page.
1 call to ListUsageController::getTitle()
- LocalTaskUsageController::getTitleLocalTask in src/
Controller/ LocalTaskUsageController.php - Title page callback.
1 string reference to 'ListUsageController::getTitle'
File
- src/
Controller/ ListUsageController.php, line 132
Class
- ListUsageController
- Controller for our pages.
Namespace
Drupal\entity_usage\ControllerCode
public function getTitle($type, $id) {
$entity = $this->entityTypeManager
->getStorage($type)
->load($id);
if ($entity) {
return $this
->t('Entity usage information for %entity_label', [
'%entity_label' => $entity
->label(),
]);
}
else {
return $this
->t('Entity Usage List');
}
}