[英]Filtering tags using Rythm template engine
目前沒有過濾機制。 但是,Rythm提供了一個稱為Dialect的實用程序,以允許模板作者使用Rythm指令的限制集。 例如, SimpleRythm
不允許您使用以下指令:
"@extends",
"@section",
"@render",
"@inherited",
"@doLayout",
"@doBody",
"@include",
"@set",
"@get",
"@init",
"@finally",
"@nosim"
雖然BasicRythm
受到更多限制,並且您不允許使用以下任何偽指令:
"@args",
"@assign",
"@debug",
"@doLayout",
"@doBody",
"@extends",
"@section",
"@render",
"@inherited",
"@i18n",
"@import",
"@include",
"@invoke",
"@locale",
"@set",
"@get",
"@init",
"@finally",
"@expand",
"@exec",
"@macro",
"@compact",
"@nocompact",
"@def ",
"@tag ",
"@return",
"@nosim",
"@verbatim"
為了使用特定的方言,而不是使用
String result = engine.render(...);
使用以下代碼:
ITemplate template = engine.getTemplate(SimpleRythm.INSTANCE, ...);
String result = template.render();
目前尚無法阻止@{...}
。 請在https://github.com/greenlaw110/rythm/issues上提交票證,以請求配置以禁用Rythm模板中的腳本
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.