树枝中的特殊字符和HTML标记问题

问题描述 投票:0回答:1

我写在管理员:ľščťžýáíé

我试试这段代码:

{{ top_content[lang]['description'] | convert_encoding('UTF-8', 'HTML-ENTITIES') }}

得到的结果在前面:ľšťžýáÃé

如果我尝试{{ top_content[lang]['description'] }}所以,它确实有效。但显示html标记。

<p>ľščťžýáíé<br></p>

这有什么不对?

php twig
1个回答
0
投票

据我所知,第二个例子几乎没问题,怎么样

{{ top_content[lang]['description']  | raw }}

要么

{{ top_content[lang]['description']  | striptags }}
© www.soinside.com 2019 - 2024. All rights reserved.