简体   繁体   中英

Is it possible to concatenate two strings in soy (Closure Templates)?

With soy, I would like to concatenate two strings (hard-coded or variables) into one. My idea was to "parametrize" the first variable with the second:

{let $key: 'abc_$anothervariable' /}

This doesn't work. I also tried using builtin join() function for lists:

{let $key: join(['abc', $anothervariable], '') /}

But this approach doesn't work either - it even seems to have invalid syntax. Is it even possible to do something like that in Closure Templates?

答案实际上很简单:

{let $key: 'abc_' + $anothervariable /}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM