Module z_template

Template handling, compiles and renders django compatible templates using the template_compiler.

Copyright © 2009-2016 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Template handling, compiles and renders django compatible templates using the template_compiler

Function Index

is_template_module/1Check if the modulename looks like a module generated by the template compiler.
module_reindexed/2Observer, triggered when there are new module files indexed.
render/2
render/3
render_block/3
render_block/4
render_block_to_iolist/4Render a block template to an iolist().
render_to_iolist/3Render a template to an iolist().
reset/1Force a reset of all templates, used after a module has been activated or deactivated.
start_link/1

Function Details

is_template_module/1

is_template_module(Module::binary() | string() | atom()) -> boolean()

Check if the modulename looks like a module generated by the template compiler.

module_reindexed/2

module_reindexed(X1::module_reindexed, Context::#context{}) -> ok

Observer, triggered when there are new module files indexed

render/2

render(Render::#render{}, Context::#context{}) -> template_compiler:render_result()

render/3

render(Template::template_compiler:template() | #module_index{}, Vars::list() | map(), Context::#context{}) -> template_compiler:render_result()

render_block/3

render_block(Block::atom(), Render::#render{}, Context::#context{}) -> template_compiler:render_result()

render_block/4

render_block(OptBlock::atom(), Template::template_compiler:template() | #module_index{}, Vars::list() | map(), Context::#context{}) -> template_compiler:render_result()

render_block_to_iolist/4

render_block_to_iolist(Block::atom(), File::template_compiler:template(), Vars::list() | map(), Context::z:context()) -> {iolist(), z:context()}

Render a block template to an iolist().

render_to_iolist/3

render_to_iolist(File::template_compiler:template() | #module_index{}, Vars::list() | map(), Context::z:context()) -> {iolist(), z:context()}

Render a template to an iolist(). This removes all scomp state etc from the rendered html and appends the information in the scomp states to the context for later rendering.

reset/1

reset(Site::atom() | #context{}) -> ok

Force a reset of all templates, used after a module has been activated or deactivated.

start_link/1

start_link(SiteProps) -> any()


Generated by EDoc