我有一个html文件,其中fatfree从.html文件呈现html代码。例如,.html文件具有以下代码;
<include href='navigation.html'>
<include href='{{ @view }}>
其中view包含.html文件的路径。
但在我的情况下,html代码由程序生成为字符串类型。如何在fatfree中将这样的字符串呈现为html,如。
<div>{{ @view }}</div>
答案 0 :(得分:1)
查看https://fatfreeframework.com/3.6/views-and-templates#Extendingfiltersandcustomtags
您可以使用过滤器来使用原始HTML代码而不是使用<div>{{ @view|raw }}</div>
转义(用于安全性)版本。
或者你可以禁用一般的转义,这是非常不鼓励的。
$f3->set('ESCAPE',FALSE);