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

13.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 will return HTTP response.

[environment] is the environment you want to pass in. We often ignore it. But if you want to ref some vars defined outside your template string, you should pass (the-environment).

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

There’re two kinds of different templating: