7.4.1 TemplateLoaderMixin
Description: TemplateLoaderMixin
Keywords: albatross

##
7.4.1 TemplateLoaderMixin

The `TemplateLoaderMixin` class is a simplistic loader which performs no caching.

`__init__`( | base_dir)

  When you inherit from the `TemplateLoaderMixin` class you must call the constructor to define the root directory where template files will be loaded in the base_dir argument.

`load_template`( | name)

  Load and return the parsed template file specified in the name argument. The path to the template file is constructed by performing `os.path.join()` on the base_dir specified in the constructor and the name argument.

  If there is an error reading the template a `TemplateLoadError` will be raised.

  The class remembers the names of all loaded templates.

`load_template_once`( | name)

  Returns `None` if the template specified in the name argument has been previously loaded. If not previously loaded it is loaded via the `load_template()` method and returned.