Ver código fonte

TwigExtension : ajout user_current

develop
Guillaume 3 anos atrás
pai
commit
e934b615d7
1 arquivos alterados com 6 adições e 0 exclusões
  1. +6
    -0
      Twig/TwigExtension.php

+ 6
- 0
Twig/TwigExtension.php Ver arquivo

@@ -85,6 +85,7 @@ class TwigExtension extends AbstractExtension
new TwigFunction('get_form_newsletter', [$this, 'getFormNewsletter']),
new TwigFunction('sov_limit_text', [$this, 'limitText']),
new TwigFunction('day_by_number', [$this, 'getDayByNumber']),
new TwigFunction('user_current', [$this, 'getUserCurrent']),
];
}

@@ -185,4 +186,9 @@ class TwigExtension extends AbstractExtension
return $this->stringComponent->slugify($string) ;
}

public function getUserCurrent()
{
return $this->security->getUser();
}

}

Carregando…
Cancelar
Salvar