Skip to content

Using several themes in the same process #79

@stof

Description

@stof

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions