Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在修饰符中组合两个变量(数组 vals)?
这有效:
<a href="{'smartphone'|buildLink:$k:$v["brand"]}">
但这不会??
<a href="{'smartphone'|buildLink:$k:$v["brand"]+$v["brand2"]}"
Smarty 语法在允许表达式的位置方面受到限制,因此您可能必须将总和分配给临时变量:
{assign var=_sum value=$v[brand]+$v[brand2]} <a href="{'smartphone'|buildLink:$k:$_sum}"