Question

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"]}"
Was it helpful?

Solution

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}"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top