Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Override Twig Template Class #4704
In some instances I would love to be able to hook in to Twig's
Some thoughts, this could be handled with an event. In
The other option, which I like more, in
If you would consider exploring either of these, please let me know, and I will open a PR with a suggestion.
Steps to reproduce
I like the event-based option better for two reasons:
Makes sense. The only issue I had with the event approach was the potential performance issues. But, boy, the extensibility of multiple plugins hooking in to a
Want me to open PR for review? I’ve been messing around with it locally to work with some template-based view-models so I’m happy to push what I have.
Turns out that
For example, here’s what we’re doing for Craft 3.3 (instead of overriding
If you go this route with a plugin, make sure to call this from the install migration’s