NAME

Krang::Pref - Krang Global Preference API


SYNOPSIS

  use Krang::ClassLoader 'Pref';
  # get the value set 'search_page_size', a scalar preference
  $page_size = pkg('Pref')->get('search_page_size');
  # get a hash of ids to names for a list preference
  %data = pkg('Pref')->get('contrib_type');
  # set a scalar preference
  pkg('Pref')->set(search_page_size => 10);
  # set a list preference with a list of ids and names
  pkg('Pref')->set(contrib_type => 1 => 'Writer', 2 => 'Photographer');


DESCRIPTION

Krang::Pref 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 supported by Krang::Pref:

New preferences can be added by editing the configuration data in this module.


INTERFACE