Twig variables as references
问题 I'm trying to change a Twig variable via a php reference but I can't achieve that. I looked around and nor with Twig functions nor with Twig filters I could do what I want. Any idea how to do that? {% set hiding_options_classes = "default" %} {{ hiding_options_func(content.field_hiding_options, hiding_options_classes) }} {{ hiding_options_classes }} In my Twig extension file: public function hiding_options_func($hiding_options, &$hiding_options_classes) { $hiding_options_classes = "coucou"; }