Skip to content

preserve camelCase in passing parameters to twig functions #4539

Closed Answered by stof
tacman asked this question in Q&A
Discussion options

You must be logged in to vote

This is solved in Twig 4 (not released yet) as names are not normalized anymore for variadic arguments (the function would have to change array keys if it expects the old behavior of turning any key to snake case).
In Twig 3, there is no way to solve that with a variadic signature. You would have to use explicit parameter names in your Twig function (so that parameter names are resolved by the Twig compiler)

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tacman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants