diff --git a/src/Bundle/ChillMainBundle/Resources/views/Entity/user_group.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Entity/user_group.html.twig new file mode 100644 index 000000000..8504a88dd --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Entity/user_group.html.twig @@ -0,0 +1 @@ +{{ user_group.label|localize_translatable_string }} diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserGroupRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserGroupRender.php new file mode 100644 index 000000000..b63fca8cf --- /dev/null +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserGroupRender.php @@ -0,0 +1,38 @@ +environment->render('@ChillMain/Entity/user_group.html.twig', ['user_group' => $entity]); + } + + public function renderString($entity, array $options): string + { + /* @var $entity UserGroup */ + return $this->translatableStringHelper->localize($entity->getLabel()); + } + + public function supports(object $entity, array $options): bool + { + return $entity instanceof UserGroup; + } +} diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserGroupRenderInterface.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserGroupRenderInterface.php new file mode 100644 index 000000000..7ebf70028 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserGroupRenderInterface.php @@ -0,0 +1,14 @@ +