문제

how to combine two variables(array vals) in a modifier?

this works:

<a href="{'smartphone'|buildLink:$k:$v["brand"]}">

but this will not??

<a href="{'smartphone'|buildLink:$k:$v["brand"]+$v["brand2"]}"
도움이 되었습니까?

해결책

Smarty syntax is limited in terms of where expressions are allowed, so you probably will have to assign the sum to a temporary variable:

{assign var=_sum value=$v[brand]+$v[brand2]}
<a href="{'smartphone'|buildLink:$k:$_sum}"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top