1 | <?php |
||
21 | class TwigActionTranslationFilter extends \Twig_Extension |
||
22 | { |
||
23 | /** |
||
24 | * The translator. |
||
25 | * |
||
26 | * @var TranslatorInterface |
||
27 | */ |
||
28 | private $translator; |
||
29 | |||
30 | /** |
||
31 | * Constructor. |
||
32 | * |
||
33 | * @param TranslatorInterface $translator The translator |
||
34 | */ |
||
35 | public function __construct(TranslatorInterface $translator) |
||
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | public function getFilters() |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | public function getName() |
||
57 | |||
58 | /** |
||
59 | * Callback of action translation Twig filter that returns resultant array. |
||
60 | * |
||
61 | * @param string $options The action options |
||
62 | * |
||
63 | * @return array|string |
||
64 | */ |
||
65 | public function actionTranslation($options) |
||
98 | } |
||
99 |