user1163513 user1163513 - 1 year ago 128
Smarty Question

Concatenation in smarty

I want to assign the value obtained from the concatenation of these two variables with a string.

{assign var="url" value="{$WS_PATH}aircraft_images/{$images[i].image}"}

Please let me know how can we do this in smarty.

Answer Source

One of these should work:

{assign var="url" value=$WS_PATH|cat:"aircraft_images/"|cat:$images[i].image}


{assign var="url" value="`$WS_PATH`aircraft_images/`$images[i].image`"}

I am not sure if the $images[i].image will be parsed correctly, you may have to {assign} it to another variable first

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download