Search code examples
smartyspecial-characters

Smarty: How to display "{" and "}" special characters


lets say I have a smarty variable TAKEN FROM DATABASE called

$myvar = "i am very happy {-: "

if I try to display it, it gave me "500 Internal Errors" because the string contains "{" character which is used by smarty. since its from the database, I dont have any control on the values it will give me... what I noticed if the string contains those characters it gives me error.

how can i display the spacial charater correctly without causing this errors? Hope somebody can help!


Solution

  • Try outputting your data between{literal} {/literal} tags. See {literal} Smarty documentation.