简体   繁体   中英

How to render Html with smarty

I'm trying to render my raw HTML with smarty.

{if !empty($brand.description)}
  {$brand.description}
{/if}

The original text contains spaces and text returns, but when displayed, HTML is shown as plain text.

Also, I tried to add {$brand.description|strip_tags:'UTF-8'} as a filter for my string. But it's only deleting my HTML.

How can my smarty template render this string as pure HTML?

Answer is...

{$brand.description nofilter}

Also, you can disable this indicator by change default smarty behavior:

$smarty->setEscapeHtml(false);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM