Module m_persistent

Model for accessing the persistent variables from a template.

Copyright 2009 Marc Worrell Date: 2009-11-20

Behaviours: gen_model.

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

Description

Model for accessing the persistent variables from a template.

Data Types

id()

id() = binary() | string()

Function Index

get/2Select full row by persistent id.
get_props/2Get only stored (persistent) props for session by id.
m_find_value/3Fetch the value for the key from a model source.
m_to_list/2Transform a m_config value to a list, used for template loops.
m_value/2Transform a model value so that it can be formatted or piped through filters.
put/3Save new persistent session data.

Function Details

get/2

get(Id::undefined | id(), Context::#context{}) -> Props::list()

Select full row by persistent id.

get_props/2

get_props(Id::undefined | id(), Context::#context{}) -> Props::list() | undefined

Get only stored (persistent) props for session by id.

m_find_value/3

m_find_value(Key::id(), Source::#m{}, Context::#context{}) -> term()

Fetch the value for the key from a model source

m_to_list/2

m_to_list(Source::#m{}, Context::#context{}) -> list()

Transform a m_config value to a list, used for template loops

m_value/2

m_value(Source::#m{}, Context::#context{}) -> term()

Transform a model value so that it can be formatted or piped through filters

put/3

put(Id::undefined | id(), Props::list(), Context::#context{}) -> ok | {error, undefined}

Save new persistent session data.


Generated by EDoc, Oct 20 2014, 23:46:48.