Module m_config

Model for the zotonic config table.

Copyright 2009 Marc Worrell Date: 2009-04-09

Behaviours: gen_model.

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

Description

Model for the zotonic config table. Performs a fallback to the site configuration when a key is not defined in the configuration table.

Function Index

all/1Return all configurations from the configuration table.
delete/3Delete the specified module/key combination.
get/2Get the list of configuration key for the module.
get/3Get a configuration value for the given module/key combination.
get_id/3Lookup the unique id in the config table from the module/key combination.
get_value/3
get_value/4
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.
set_prop/5Set a "complex" config value.
set_value/4Set a "simple" config value.

Function Details

all/1

all(Context) -> any()

Return all configurations from the configuration table. Returns a nested proplist (module, key)

delete/3

delete(Module::atom(), Key::atom(), Context::#context{}) -> ok

Delete the specified module/key combination

get/2

get(Module, Context) -> any()

Get the list of configuration key for the module.

get/3

get(Module::atom(), Key::atom(), Context::#context{}) -> Value | undefined

Get a configuration value for the given module/key combination.

get_id/3

get_id(Module, Key, Context) -> any()

Lookup the unique id in the config table from the module/key combination.

get_value/3

get_value(Module, Key, Context) -> any()

get_value/4

get_value(Module, Key, Default, Context) -> any()

m_find_value/3

m_find_value(Module::Key, M::Source, Context) -> term()

Fetch the value for the key from a model source

m_to_list/2

m_to_list(M::Source, Context) -> List

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

m_value/2

m_value(M::Source, Context) -> term()

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

set_prop/5

set_prop(Module::atom(), Key::atom(), Prop::atom(), PropValue::any(), Context::#context{}) -> ok

Set a "complex" config value.

set_value/4

set_value(Module::atom(), Key::atom(), Value::string(), Context::#context{}) -> ok

Set a "simple" config value.


Generated by EDoc, Dec 22 2014, 10:57:51.