View Source template_compiler_runtime_internal (template_compiler v3.5.0)
Callback routines for compiled templates.
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.
Compose include of a template, with overruling blocks.
Runtime implementation of a forloop.
Include a template.
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.
Functions
Call the block function, lookup the function in the BlockMap to find the correct module.
-spec block_inherit({binary(), integer(), integer()}, term(), atom(), map(), map(), atom(), term()) -> term().
Call the block function of the template the current module extends.
-spec call(Module :: atom(), Args :: map(), Vars :: map(), Context :: term()) -> template_compiler:render_result().
Call a module's render function.
compose(SrcPos, Template, Args, Runtime, ContextVars, IsContextVars, Vars, BlockList, BlockModule, BlockFun, Context)
-spec compose(SrcPos, Template, Args, Runtime, ContextVars, IsContextVars, Vars, BlockList, BlockModule, BlockFun, Context) -> Output when SrcPos :: {File :: binary(), Line :: integer(), Col :: integer()}, Template :: template_compiler:template(), Args :: [{atom(), term()}], Runtime :: atom(), ContextVars :: [binary()], IsContextVars :: boolean(), Vars :: map(), BlockList :: [atom()], BlockModule :: atom(), BlockFun :: function(), Context :: term(), Output :: template_compiler:render_result().
Compose include of a template, with overruling blocks.
forloop(IsForloopVar, ListExpr, LoopVars, LoopBody, EmptyPart, Runtime, IsContextVars, Vars, Context)
-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.
-spec include(SrcPos, Method, Template, Args, Runtime, ContextVars, IsContextVars, Vars, Context) -> Output when SrcPos :: {File :: binary(), Line :: integer(), Col :: integer()}, Method :: normal | optional | all, Template :: template_compiler:template() | undefined, Args :: [{atom(), term()}], Runtime :: atom(), ContextVars :: [binary()], IsContextVars :: boolean(), Vars :: map(), Context :: term(), Output :: template_compiler:render_result().
Include a template.
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.
Assign variables from a with statement. Care has to be taken for unpacking tuples and lists.