Copyright © 2009 Marc Worrell
Behaviours: gen_server.
Authors: Marc Worrell (marc@worrell.nl).
code_change/3 | |
compile/2 | Compile a template, retun the module name. |
find_template/2 | Finds the template designated by the file, check modules. |
find_template/3 | Finds the first or all templates designated by the file, check modules. |
find_template_cat/3 | Finds the template designated by the file, for the category of the rsc with id, check modules. |
handle_call/3 | Compile the template if it has been modified, return the template module for rendering. |
handle_cast/2 | Reset all compiled templates, done by the module_indexer after the module list changed. |
handle_info/2 | |
init/1 | Initialize the template server, handles template compiles and rendering. |
is_template_module/1 | Check if the module is a template module. |
render/3 | Render a template. |
render_to_iolist/3 | Render a template to an iolist(). |
reset/1 | Force a reset of all templates, used after a module has been activated or deactivated. |
start_link/1 | |
terminate/2 |
code_change(OldVersion, State, Extra) -> any()
compile(File, Context) -> {ok, atom()} | {error, Reason}
Compile a template, retun the module name.
find_template(File, Context) -> {ok, filename()} | {error, code}
Finds the template designated by the file, check modules. When the file is an absolute path, then do nothing and assume the file exists.
find_template(File, X2::All, Context) -> FilenameList
Finds the first or all templates designated by the file, check modules.
find_template_cat(File, Id, Context) -> {ok, filename()} | {error, code}
Finds the template designated by the file, for the category of the rsc with id, check modules. When the file is an absolute path, then do nothing and assume the file exists.
handle_call(X1::{check_modified, File}, From, State) -> {ok, Module} | {error, Reason}
Compile the template if it has been modified, return the template module for rendering.
handle_cast(Msg, State) -> any()
Reset all compiled templates, done by the module_indexer after the module list changed.
handle_info(Msg, State) -> any()
init(SiteProps::Args) -> {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}
Initialize the template server, handles template compiles and rendering.
is_template_module(Module::atom()) -> bool()
Check if the module is a template module.
render(File, Variables, Context) -> list()
Render a template. First requests the template module from the template server, then renders the template. The resulting list contains the rendered template and scomp contexts. Use render_to_iolist/3 to get a iolist().
render_to_iolist(File, Vars, Context) -> {iolist(), 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(Context) -> any()
Force a reset of all templates, used after a module has been activated or deactivated.
start_link(SiteProps) -> any()
terminate(Reason, State) -> any()
Generated by EDoc, Feb 25 2011, 21:14:41.