use of core.framework.impl.template.TemplateContext in project core-ng-project by neowu.
the class TemplateManager method process.
public String process(String templatePath, Object model, String language) {
StopWatch watch = new StopWatch();
try {
HTMLTemplate template = get(templatePath, model.getClass(), language);
TemplateContext context = new TemplateContext(model, cdnManager);
return template.process(context);
} finally {
logger.debug("process, templatePath={}, elapsedTime={}", templatePath, watch.elapsedTime());
}
}
use of core.framework.impl.template.TemplateContext in project core-ng-project by neowu.
the class HTMLTemplateEngine method process.
public String process(String name, Object model) {
StopWatch watch = new StopWatch();
try {
HTMLTemplate template = templates.get(name);
if (template == null)
throw Exceptions.error("template not found, name={}", name);
TemplateContext context = new TemplateContext(model, cdnManager);
return template.process(context);
} finally {
logger.debug("process, name={}, elapsedTime={}", name, watch.elapsedTime());
}
}
Aggregations