How to concatenate two values in smarty

Home Forums Why smarty template is best for web development How to concatenate two values in smarty

Tagged: 

This topic contains 2 replies, has 1 voice, and was last updated by  ajay 3 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #370

    Aniket

    I have two values which i want to concatenate to show the output. How to  concatenate the values in smarty template.

    #373

    student

    To concatenate two values in smarty use cat modifier

    for example- if you want to concatenate firstname and secondname then concatenate the name like this

    {$firstname|cat:$secondname}

    #503

    ajay

    If you want to keep space between words while concatenating the value in smarty you can do like this

    {$firstname|cat:’ ‘|cat:$secondname}

     

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.