- Issue created by @darren.fisher
- @darrenfisher opened merge request.
- π¬π§United Kingdom darren.fisher
Branch and merge request created.
https://git.drupalcode.org/project/twig_tweak/-/merge_requests/58To test as a patch you can use:
https://git.drupalcode.org/project/twig_tweak/-/merge_requests/58.patchFeedback welcome!
- π·πΊRussia Chi
There is a couple reason why this shouldn't be part of Twig Tweak.
1. Twig Tweak does not have to incorporate all possible Twig functions and filters. There is no such a goal to become the only Twig related module in Drupal. Specific use cases should be addressed in specific modules. Twig casings covers quite specific use case. Btw, I did similar filters in Drupal Code Generator.
2. Twig Tweak does not aim to improve Twig itself. It's primary focused on integration with Drupal. Π‘heck out list of our functions and filters. They are almost all related to Drupal. I think general things like string transformation should be implemented in Twig core or in a separate Twig extension (ordinary Composer package, not a Drupal module).
Thanks.
- π·πΊRussia Chi
a separate Twig extension
An example of such extension.
https://github.com/jawira/case-converter-twigIntegration it into Drupal should be as simple as declaring a service in yml file.
- π¬π§United Kingdom darren.fisher
Fair enough. Thanks for giving it a review anyway.