Concatenation string with variable in smarty

hippout picture hippout · Jan 28, 2010 · Viewed 25.1k times · Source

I need in smarty template to transmit to function concatenated string constant with variable value, How can i do it?

some example code: {$obj->calledFunc('string const').$var} but . operator doesn't work

Answer

Deebster picture Deebster · Feb 1, 2010

Use the cat modifier:

{$obj->calledFunc('string const')|cat:$var}