Krang::ElementLibrary - the element class loader and indexer


  use Krang::ClassLoader 'ElementLibrary';
  # load an element set by name
  pkg('ElementLibary')->load_set(set => "Flex");
  # get a list of available top level elements
  @top_levels = pkg('ElementLibary')->top_levels());
  # get the object for the top level called "article" from the current set
  $class = pkg('ElementLibary')->top_level(name => "article");
  # find a class within the current set
  $class = pkg('ElementLibrary')->find_class(name => "deck")
  # get a list of all element names, anywhere in the element library
  @names = pkg('ElementLibrary')->element_names();
  # get the list of other elements that "paragraph" can be changed into
  @classes = pkg('ElementLibrary')->changeable_classes('paragraph');


This module is responsible for loading the Krang Element Library and allowing access to the classes contained within it. Each instance is configured with an element set in krang.conf:

  <Instance test>
     InstanceElementSet Flex

This library is responsible for loading the configured element sets and responding to requests to find individual element classes.

Element Sets

An element set consists of a configuration file, set.conf, and a series of Perl modules implementing the element classes. The configuration file is in Apache format and may contain the following directives:



Implement KrangVersion checking.