Krang::MyPref - Krang user preference API
use Krang::ClassLoader 'MyPref';
# get the value set 'search_page_size', a scalar preference
$page_size = pkg('MyPref')->get('search_page_size');
# set a scalar preference
pkg('MyPref')->set(search_page_size => 10);
Krang::MyPref provides a means for the user to access and change configurable settings.
There are two types of Preferences: scalars and lists. A scalar preference accepts a single value. A list preference contains a list of values, identified by unique IDs mapping to names.
The following preferenes are currently supported by Krang::MyPref:
New preferences can be added by editing the configuration data in this module.
If no value has been configured for the preference then nothing is returned (undef in scalar context, empty list in list context).
The second argument '$user_id' is optional. If not specified, this
method will return the preference(s) of the logged-in user.
Note that this method does not do any dependency checking on values being removed from the table.