From 4f309f6684c5109a2cf6c8ff84c1a01d103fe7fe Mon Sep 17 00:00:00 2001 From: Fredrik de Vibe Date: Sun, 19 Oct 2014 23:46:21 +0200 Subject: [PATCH] Document template_auto_escape. --- doc-src/api-view.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc-src/api-view.html b/doc-src/api-view.html index e2e4667c..6bc45f10 100644 --- a/doc-src/api-view.html +++ b/doc-src/api-view.html @@ -17,6 +17,10 @@

Custom tags

Another option for factoring out repeated logic is to use ErlyDTL's "include" tag. The difference between using an "include" tag and custom tags is that "include" will have access to all variables currently in the caller's scope, whereas custom tags only have access to the variables explicitly passed in. (In addition, custom tags are compiled only once for the entire project, but included files are compiled for each template that includes it.)

Helper modules for custom tags and filters

For more complicated processing, you can create helper modules. Tag helper modules reside in src/view/lib/tag_modules, and export functions which take in a proplist of variables and return rendered HTML. Filter helper modules reside in src/view/lib/filter_modules, and export functions which take in a binary string and return a filter iolist. See those directories in your project for examples.

+ +

Configuring ErlyDTL

+

By default, ErlyDTL escapes HTML in values that are passed in template variables. This behaviour is configurable in CB, by setting the value of template_auto_escape to either true or false in boss.config.

+

Implicit variables

The following variables are automatically passed to your views without you doing any work: