class MyTemplateHandler
super Handler
# Template to render
var template = new TemplateString("""
<h1>Hello %USER%!</h1>
<p>Welcome to %MYSITE%.</p>
""")
redef fun get(req, res) do
# Values to add in the template
var values = new HashMap[String, String]
values["USER"] = "Morriar"
values["MYSITE"] = "My super website"
# Render it
res.template(template, values)
end
end
lib/popcorn/examples/templates/example_templates.nit:22,1--40,3