Domanda

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"]}"
È stato utile?

Soluzione

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}"
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top