mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 21:13:57 +00:00
fix sf4 deprecated using get() method for private container
This commit is contained in:
@@ -26,7 +26,22 @@ use Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
||||
class TranslatableStringTwig extends \Twig_Extension
|
||||
{
|
||||
use ContainerAwareTrait;
|
||||
|
||||
|
||||
/**
|
||||
* @var TranslatableStringHelper $helper
|
||||
*/
|
||||
private $helper;
|
||||
|
||||
/**
|
||||
* TranslatableStringTwig constructor.
|
||||
*
|
||||
* @param TranslatableStringHelper $translatableStringHelper
|
||||
*/
|
||||
public function __construct(TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
$this->helper = $translatableStringHelper;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns a list of filters to add to the existing list.
|
||||
*
|
||||
@@ -42,7 +57,7 @@ class TranslatableStringTwig extends \Twig_Extension
|
||||
|
||||
public function localize(array $translatableStrings)
|
||||
{
|
||||
return $this->container->get('chill.main.helper.translatable_string')
|
||||
return $this->helper
|
||||
->localize($translatableStrings);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user