Joining array in Volt #15620
Unanswered
wurst-hans
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You could try the var|join("<br />")|nl2br Which is a hacky workaround, but it should work. Alternatively, you could go down to raw PHP implode("\n",$var) Finally, you could write your own filter. None of these solutions preclude the possibility that there might just be a way to use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Trying to join an array with newline, i.e.
var|join("\n")
does not work, because Volt translates double quotes to single quotes. Looking into compiled Volt file this becomesjoin('\n')
. What can I do?Beta Was this translation helpful? Give feedback.
All reactions