You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2026. It is now read-only.
Currently, it is not possible to use the same template in different themes in the same PHP process, because the Twig_Loader_Filesystem caches the resolution of template names to file names in memory.
Fixing this would require replacing the Filesystem loader with a theme-aware version (it would also be required for #50 btw).
My use case for rendering the template in different themes int he same process is background processing: I select the theme based on the user in my app. The background process sending them emails should also use the right theme. But the process can send emails to users with different themes.
Not being able to change the theme is already an issue when doing it in a command, but it becomes even worse when the logic is in a RabbitMQ consumer (as the process is long-running).
As I need it at work, I will look into implementing it.
Currently, it is not possible to use the same template in different themes in the same PHP process, because the Twig_Loader_Filesystem caches the resolution of template names to file names in memory.
Fixing this would require replacing the Filesystem loader with a theme-aware version (it would also be required for #50 btw).
My use case for rendering the template in different themes int he same process is background processing: I select the theme based on the user in my app. The background process sending them emails should also use the right theme. But the process can send emails to users with different themes.
Not being able to change the theme is already an issue when doing it in a command, but it becomes even worse when the logic is in a RabbitMQ consumer (as the process is long-running).
As I need it at work, I will look into implementing it.