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 7. Anatomy of the Template Toolkit

Chapter 7. Anatomy of the Template Toolkit

Now that we've spent a great deal of time looking at what you can do with the Template Toolkit, let's take a look inside and get a feel for how it actually works. We'll follow the flow of processing a template from the frontend (such as Template or ttree), to getting the file from disk (Template::Provider), to compiling it (Template::Parser, Template::Grammar, and Template::Directive), and to executing it (Template::Context and Template::Document).

We'll be using pseudocode versions of the methods to illustrate the major thrust of each component, mainly to gloss over tedious details of error checking, parameter handling, file opening and closing, and syntax. Feel free to get a copy of each .pm file and follow along with the real code; however, the best way to understand any complex system is to look at the innards, and the Template Toolkit is no exception.


  

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