I know how to access the snippet in the twig, but how can I do that from the PHP class? We had a way of accessing any snippet from the namespace in SW5, but I am lost how do to achieve the same for SW6.
Any help is appreciated.
I know how to access the snippet in the twig, but how can I do that from the PHP class? We had a way of accessing any snippet from the namespace in SW5, but I am lost how do to achieve the same for SW6.
Any help is appreciated.
Use the symfony trannslator as dependency of your service or class and access your snippet like this example.
$label = $this->translator->trans(‘your-label’);