Book description
Among the many different approaches to "templating" with Perl--such as Embperl, Mason, HTML::Template, and hundreds of other lesser known systems--the Template Toolkit is widely recognized as one of the most versatile. Like other templating systems, the Template Toolkit allows programmers to embed Perl code and custom macros into HTML documents in order to create customized documents on the fly. But unlike the others, the Template Toolkit is as facile at producing HTML as it is at producing XML, PDF, or any other output format. And because it has its own simple templating language, templates can be written and edited by people who don't know Perl. In short, the Template Toolkit combines the best features of its competitors, with ease-of-use and flexibility, resulting in a technology that's fast, powerful and extensible, and ideally suited to the production and maintenance of web content and other dynamic document systems.In Perl Template Toolkit you'll find detailed coverage of this increasingly popular technology. Written by core members of the technology's development team, the book guides you through the entire process of installing, configuring, using, and extending the Template Toolkit. It begins with a fast-paced but thorough tutorial on building web content with the Template Toolkit, and then walks you through generating and using data files, particularly with XML. It also provides detailed information on the Template Toolkit's modules, libraries, and tools in addition to a complete reference manual.Topics in the book include:
- Getting started with the template toolkit
- The Template language
- Template directives
- Filters
- Plugins
- Extending the Template Toolkit
- Accessing databases
- XML
- Advanced static web page techniques
- Dynamic web content and web applications
Publisher resources
Table of contents
- A Note Regarding Supplemental Files
- Preface
- 1. Getting Started with the Template Toolkit
- 2. Building a Complete Web Site Using the Template Toolkit
- 3. The Template Language
- 4. Template Directives
-
5. Filters
- Using Filters
-
Standard Template Toolkit Filters
- collapse
- eval / evaltt
- format(fmt)
- html
- html_break / html_para_break
- html_entity
- html_line_break
- html_para
- indent(pad)
- latex(outputType)
- lcfirst
- lower
- null
- perl / evalperl
- redirect(file, options)
- remove(string)
- repeat(iterations)
- replace(search, replace)
- stderr
- stdout(options)
- trim
- truncate(length)
- ucfirst
- upper
- uri
- 6. Plugins
-
7. Anatomy of the Template Toolkit
- Template Modules
- The Runtime Engine
-
Module Interfaces
- Template’s process Method
- Template::Config
- Template::Constants
- Template::Base
- Template::Context
- Template::Provider
- Template::Stash
- Template::Filters
- Template::Plugin
- Template::Plugins
- Template::Parser and Template::Grammar
- Template::Directive
- Template::Document
- Template::Exception
- Template::Iterator
-
8. Extending the Template Toolkit
- Using and Implementing Noncore Components
- Creating Filters
- Creating Plugins
- Building a New Frontend
- Changing the Language
- 9. Accessing Databases
- 10. XML
- 11. Advanced Static Web Page Techniques
- 12. Dynamic Web Content and Web Applications
-
A. Appendix: Configuration Options
-
Template Toolkit Configuration Options
- ABSOLUTE
- ANYCASE
- AUTO_RESET
- BLOCKS
- CACHE_SIZE
- COMPILE_EXT
- COMPILE_DIR
- CONSTANTS
- CONSTANT_NAMESPACE
- NAMESPACE
- CONTEXT
- DEBUG
- DEBUG_FORMAT
- DEFAULT
- DELIMITER
- ERROR
- EVAL_PERL
- FACTORY
- FILTERS
- GRAMMAR
- INCLUDE_PATH
- INTERPOLATE
- LOAD_FILTERS
- LOAD_PERL
- LOAD_PLUGINS
- LOAD_TEMPLATES
- OUTPUT_PATH
- OUTPUT
- PARSER
- PLUGIN_BASE
- PLUGINS
- PRE_CHOMP, POST_CHOMP
- PRE_DEFINE, VARIABLES
- PRE_PROCESS, POST_PROCESS
- PROCESS
- RECURSION
- RELATIVE
- SERVICE
- STASH
- START_TAG, END_TAG
- TAG_STYLE
- TOLERANT
- TRIM
- VARIABLES, PRE_DEFINE
- V1DOLLAR
-
Apache::Template Configuration Options
- TT2Tags
- TT2PreChomp
- TT2PostChomp
- TT2Trim
- TT2AnyCase
- TT2Interpolate
- TT2IncludePath
- TT2Absolute
- TT2Relative
- TT2Delimiter
- TT2PreProcess
- TT2PostProcess
- TT2Process
- TT2Default
- TT2Error
- TT2EvalPerl
- TT2LoadPerl
- TT2Recursion
- TT2PluginBase
- TT2AutoReset
- TT2CacheSize
- TT2CompileExt
- TT2CompileDir
- TT2Debug
- TT2Headers
- TT2Params
- TT2ServiceModule
-
Template Toolkit Configuration Options
- Index
- About the Authors
- Colophon
- Copyright
Product information
- Title: Perl Template Toolkit
- Author(s):
- Release date: December 2003
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596004767
You might also like
book
Perl One-Liners
Perl One-Liners showcases 130 short and compelling lines of code that do all sorts of handy, …
book
Perl Best Practices
Many programmers code by instinct, relying on convenient habits or a "style" they picked up early …
book
Beginning Perl
Everything beginners need to start programming with Perl Perl is the ever-popular, flexible, open source programming …
book
Perl in a Nutshell, 2nd Edition
This complete guide to the Perl programming language ranges widely through the Perl programmer's universe, gathering …