Use ElementTypeNameGenerator where possible

This commit is contained in:
Jan Böhmer 2025-11-10 00:48:25 +01:00
parent e95197b069
commit c372109a2f
5 changed files with 37 additions and 60 deletions

View file

@ -76,6 +76,8 @@ final class EntityExtension extends AbstractExtension
/* Gets a human readable label for the type of the given entity */
new TwigFunction('entity_type_label', fn(object|string $entity): string => $this->nameGenerator->getLocalizedTypeLabel($entity)),
new TwigFunction('type_label', fn(object|string $entity): string => $this->nameGenerator->typeLabel($entity)),
new TwigFunction('type_label_p', fn(object|string $entity): string => $this->nameGenerator->typeLabelPlural($entity)),
];
}