首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将模板文件动态加载到Rythm?(不设置目录)

将模板文件动态加载到Rythm?(不设置目录)
EN

Stack Overflow用户
提问于 2016-04-18 06:00:11
回答 1查看 111关注 0票数 1

我希望能够做一些像这样的事情

代码语言:javascript
复制
// be able to replace this section
Map<String, Object> map = new HashMap<>();
map.put("home.template", "resources"); // foo.html and bar.html (foo invoke bar)
Rythm.init(map);
System.out.println(Rythm.render("foo.html", "World"));

// with this section
Rythm.put("foo.html", fooTemplateStr);//dynamically add/replace foo.html to template repository
Rythm.put("bar.html", barTemplateStr);//dynamically add/replace bar.html to template repository
System.out.println(Rythm.render("foo.html", "World"));

我正在构建一个简单的博客引擎,允许用户通过web界面设置/更改模板。但我需要用Rythm将模板固定在目录或jar文件中,我可以动态加载它们吗?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36682705

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档