From a09738ec83fe846e0f315a6527343d8b76a15355 Mon Sep 17 00:00:00 2001 From: Ferdinand Kuhl Date: Thu, 9 Nov 2023 16:32:15 +0100 Subject: [PATCH] allow trait consumers to use the prepared eel evaluator --- Classes/EelFilenameTrait.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Classes/EelFilenameTrait.php b/Classes/EelFilenameTrait.php index 3bbef2e..32cf333 100644 --- a/Classes/EelFilenameTrait.php +++ b/Classes/EelFilenameTrait.php @@ -6,6 +6,7 @@ namespace DigiComp\AttachmentViewUtility; use Neos\Eel\CompilingEvaluator; use Neos\Eel\Context; +use Neos\Eel\EelEvaluatorInterface; use Neos\Eel\Helper\ArrayHelper; use Neos\Eel\Helper\StringHelper; use Neos\Flow\Annotations as Flow; @@ -47,7 +48,13 @@ trait EelFilenameTrait throw new \RuntimeException('Your view options could not be found', 1697550440); } $expression = $this->options[$this->eelExpressionOptionKey]; - $context = new Context(\array_merge($variables, [ + + return $this->getEelResult($expression, $variables); + } + + protected function getEelResult(string $expression, array $contextVariables) + { + $context = new Context(\array_merge($contextVariables, [ 'Array' => new ArrayHelper(), 'String' => new StringHelper(), 'Translation' => new TranslationHelper(),