Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 8. Extending the Template Toolki... > Using and Implementing Noncore Compo...

8.1. Using and Implementing Noncore Components

Each Template Toolkit module knows about the other modules it needs to do its job, and will create instances of these objects unless one is passed to it explicitly. This means that modules are loaded and instances created on demand. The Template::Config module provides a convenient and centralized place to override core elements of the Template Toolkit, in the form of factory methods for each major component—context, filters, iterator, parser, plugins, provider, service, stash, and constants. The type of object that each method creates is, in turn, controlled by a series of variables in the $Template::Config namespace:

$CONTEXT   = 'Template::Context';
$FILTERS   = 'Template::Filters';
$ITERATOR  = 'Template::Iterator';
$PARSER    = 'Template::Parser';
$PLUGINS   = 'Template::Plugins';
$PROVIDER  = 'Template::Provider';
$SERVICE   = 'Template::Service';
$STASH     = 'Template::Stash';
$CONSTANTS = 'Template::Namespace::Constants';


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial