Generating patterns at runtime Framework Framework

Using the Play platform, it would be easy to allow an administrator user to create and edit templates, and then display templates.

Thus, CMS functionality is similar to functionality.

I am new to the Play Framework and evaluate it for use in a personal project.

Edit
An alternative is to simply use an editor such as CKEditor, and simply save the html from this into the database and provide some CSS forwarding, but would prefer to allow users who know more to edit the templates.

+5
source share
1 answer

, .

, HTML. , (, ), HTML.

, Play templates ( ), . , Play 1.2.x - , , Play 2.x. , -, ( TemplateLoader.load( VirtualFile) , )

String name = "mytemplate";
String source = "hi ${name}";
Template template = new GroovyTemplateCompiler().compile(new GroovyTemplate(name, source)));
Map<String,Object> args = new HashMap<String,Object>();
args.put("name","mom");
String renderedHtml = template.render(args);
+1

All Articles