Get Smarty

Donate

Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

$escape_html

设置$escape_html为true,Smarty将会为所有模板里的变量调用 htmlspecialchars({$output}, ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET);, 效果等同于调用{$variable|escape:"html"}

模板设计者可以有选择地使用nofilter标签来关闭此特性在某个变量上的作用:{$variable nofilter}

修饰器和过滤器的执行顺序如下: 修饰器, 默认修饰器, $escape_html设置, 注册的变量过滤器, 自动加载的变量过滤器, 模板实例的变量过滤器。 在默认修饰器后执行的每个步骤都可以使用nofilter标签来关闭。

Note

这是编译时的选项。如果修改了该参数,你必须重新编译对应的模板才能生效。

Comments
No comments for this page.

Advertisement

Sponsors [info]

Sponsors