FeatureToggleBundle
FeatureToggleBundle copied to clipboard
Why use tokenParser instead of twig function?
I dont really understand what the benefit is of the tokenParser here, as it basically just mimiks an if clause, doesnt it?
However i can see some cons:
- it needs a cache-clear, a twig function doesnt need a cache-clear when changing the config
- it cant be used in if/else or tenary clauses
- codewise its much more verbose
What do you think?
The reason for this was to execute the most of the code on Twig compilation and reduce performance impact on page rendering. This may or may not be justified / implemented correctly ;)