Smarty template engine is displaying css code

74 Views Asked by At

Hello i am trying to add options to a select but smarty is outputting the css code as a string.I cant get it to work with php or javascript, I am using this function to replace the html

function unEscape(htmlStr) {
htmlStr = htmlStr.replace(/&lt;/g , "<");    
htmlStr = htmlStr.replace(/&gt;/g , ">");     
htmlStr = htmlStr.replace(/&quot;/g , "\"");  
htmlStr = htmlStr.replace(/&#39;/g , "\'");   
htmlStr = htmlStr.replace(/&amp;/g , "&");
<br>return htmlStr;
}

And it works when i replace a table element with the same variable but not as a select option.Can anybody help please?For example it will show <b><br><small> but not apply the css

1

There are 1 best solutions below

1
noobeveryday On

You can use the escape modificator for printing the text:

{$text|escape}