mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
add age in some place and re-organize some usage of the component
This commit is contained in:
@@ -76,7 +76,9 @@ class PersonRender extends AbstractChillEntityRender
|
||||
*/
|
||||
public function renderString($person, array $options): string
|
||||
{
|
||||
if (null !== $person->getAge() && $person->getDeathDate() === null) {
|
||||
$options = array_merge(['addAge' => true], $options);
|
||||
|
||||
if (null !== $person->getAge() && $person->getDeathDate() === null && $options['addAge']) {
|
||||
return $person->getFirstName() . ' ' . $person->getLastName()
|
||||
. $this->addAltNames($person, false) . ' (' . $this->translator->trans('years_old', ['age' => $person->getAge()]) . ')';
|
||||
}
|
||||
|
Reference in New Issue
Block a user