Next: , Previous: , Up: Layouts and Rendering in GNU Artanis   [Contents]

14.4 Templating APIs

(tpl->response filename/sxml [environment <- (the-environment)] [escape? <- #f])

(tpl->html filename/sxm [environment <- (the-environment)] [escape? <- #f])

The difference is that tpl->html returns a string, but tpl->response returns an HTTP object response.

[environment] is the environment you want to use. We often ignore it. If you want to ref some vars defined outside your template string, you need to pass this variable.

[escape?] If you want to char-escape the HTML with the returned string, set it to #t.

There are two main ways of writing templates: