View Source template_compiler_runtime_internal (template_compiler v2.8.1)

Callback routines for compiled templates.

Link to this section Summary

Functions

Call the block function, lookup the function in the BlockMap to find the correct module.
Call the block function of the template the current module extends.
Call a module's render function.
Echo the HTML escape value within <pre> tags.
Make an unique string (about 11 characters). Used for expanding unique args in templates. The string only consists of the characters A-Z and 0-9 and is safe to use as HTML element id.
Assign variables from a with statement. Care has to be taken for unpacking tuples and lists.

Link to this section Functions

Link to this function

block_call(SrcPos, Block, Vars, BlockMap, Runtime, Context)

View Source
-spec block_call({binary(), integer(), integer()}, atom(), map(), map(), atom(), term()) -> term().
Call the block function, lookup the function in the BlockMap to find the correct module.
Link to this function

block_inherit(SrcPos, Module, Block, Vars, BlockMap, Runtime, Context)

View Source
-spec block_inherit({binary(), integer(), integer()}, atom(), atom(), map(), map(), atom(), term()) ->
                 term().
Call the block function of the template the current module extends.
Link to this function

call(Module, Args, Vars, Context)

View Source
-spec call(Module :: atom(), Args :: map(), Vars :: map(), Context :: term()) ->
        template_compiler:render_result().
Call a module's render function.
Link to this function

forloop(IsForloopVar, ListExpr, LoopVars, LoopBody, EmptyPart, Runtime, IsContextVars, Vars, Context)

View Source
-spec forloop(IsForloopVar :: boolean(),
        ListExpr :: term(),
        LoopVars :: [atom()],
        LoopBody :: fun(),
        EmptyPart :: fun(),
        Runtime :: atom(),
        IsContextVars :: boolean(),
        Vars :: map(),
        Context :: term()) ->
           term().
Runtime implementation of a forloop.
Link to this function

include(SrcPos, Method, Template, Args, Runtime, ContextVars, IsContextVars, Vars, Context)

View Source
-spec include({File :: binary(), Line :: integer(), Col :: integer()},
        normal | optional | all,
        template_compiler:template(),
        [{atom(), term()}],
        atom(),
        [binary()],
        boolean(),
        map(),
        term()) ->
           template_compiler:render_result().
Include a template.
-spec print(term()) -> iolist().
Echo the HTML escape value within <pre> tags.
-spec unique() -> binary().
Make an unique string (about 11 characters). Used for expanding unique args in templates. The string only consists of the characters A-Z and 0-9 and is safe to use as HTML element id.
-spec with_vars([atom()], [term()], map()) -> map().
Assign variables from a with statement. Care has to be taken for unpacking tuples and lists.