PersonRender: adapt twig template to suffixText

This commit is contained in:
nobohan 2022-02-16 15:55:26 +01:00
parent 81b7b49170
commit 02716a6a93
3 changed files with 7 additions and 1 deletions

View File

@ -12,6 +12,7 @@
* hLevel integer
* addDeath bool
* addAgeBadge bool
* suffixText bool
* address_multiline bool
* customButtons [
'before' Twig\Markup, (injected with macro)
@ -46,6 +47,11 @@
<span>({{- 'years_old'|trans({ 'age': person.age }) -}})</span>
{% endif %}
{% endif %}
{%- if options['suffixText'] is defined -%}
{% for o in options['suffixText'] %}
<span>{{ o }}</span>
{% endfor %}
{% endif %}
{% endmacro raw %}
{% macro label(person, options) %}

View File

@ -60,6 +60,7 @@ class PersonRender extends AbstractChillEntityRender implements PersonRenderInte
'customArea' => $options['customArea'] ?? [],
'addDeath' => $options['addDeath'] ?? true,
'addAgeBadge' => $options['addAgeBadge'] ?? false,
'suffixText' => $options['suffixText'] ?? [],
];
return

View File

@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Templating\Entity;
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\PersonBundle\Entity\Person;
/**
* Render a Person.