类 CreateContentFileDirective

所有已实现的接口:
Directive, HttpDirective, freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

@Component public class CreateContentFileDirective extends AbstractTemplateDirective
createContentFile 创建内容静态文件指令

参数列表

  • id:内容id
  • lang:语言
  • templatePath:模板路径
  • filePath:静态文件路径
  • pageIndex:当前页码,默认为1

返回结果

  • url:静态文件路径

使用示例

<@tools.createContentFile id=1 templatePath='content.html' filePath='content/'+1+'.html'>${url}</@tools.createContentFile>

<script>
fetch('${site.dynamicPath}api/directive/tools/createContentFile?id=1&templatePath=content.html&filePath=content/1.html',{"headers":{"appToken":"接口访问授权Token"}}).then(res => res.json()).then(data=>{
  console.log(data);
});
</script>