Template::Modules(3)
πΈ NAME πΈ
Template::Modules β Template Toolkit Modules π
hiii bestie, you're reading the Template::Modules(3) page from the User Contributed Perl Documentation β it's literally the map of the whole Template Toolkit module family π«Ά
π¦ Template Toolkit Modules π¦
okay so this page is the overview of all the different modules that make up the Template Toolkit. iykyk β¨
π Template π
The Template module is the front-end to the Template Toolkit for Perl programmers. main character energy fr π
use Template;
my $tt = Template->new();
$tt->process('hello.html', message => 'Hello World');
π Template::Base π
The Template::Base module implements a base class from which the other Template Toolkit modules are derived. It implements common functionality for creating objects, error reporting, debugging, and so on. iconic inheritance behavior π
π Template::Config π
The Template::Config module defines the configuration of the Template Toolkit for your system. It is an example of a factory module which is responsible for instantiating the various other modules used in the Template Toolkit. factory girl vibes πβ¨
For example, the Template::Config module defines the $STASH package variable which indicates which version of the Template::Stash you are using by default. If you elected to use the faster XS stash when you installed the Template Toolkit, then this will be set as:
$STASH = 'Template::Stash::XS';
Otherwise you'll get the regular Perl stash:
$STASH = 'Template::Stash';
This approach means that other parts of the Template Toolkit don't have to worry about which stash you're using. They just ask the Template::Config module to create a stash of the right kind. no cap, that's a slay π
π Template::Constants π
The Template::Constants module defines a number of constants that are used by the Template Toolkit. little constants doing big things π
For example, the :chomp tagset defines the CHOMP_??? constants that can be used with the PRE_CHOMP and POST_CHOMP configuration options.
use Template::Constants ':chomp';
my $tt = Template->new({
PRE_CHOMP => CHOMP_COLLAPSE,
});
π Template::Context π
The Template::Context module defines a runtime context in which templates are processed. A context keeps track of all the templates, variables, plugins, and other resources that are available (either directly or through delegate objects) and provides methods to fetch, store, and perform various operations on them. it's giving runtime headquarters π§β¨
π Template::Document π
The Template::Document module implements a compiled template document object. This is generated by the Template::Parser module. compiled and cute π
π Template::Exception π
The Template::Exception module implements an exception object which is used for runtime error reporting. dramatic error moment, but make it structured ππ
π Template::Filters π
The Template::Filters module implements a filter provider. It includes the core collection of filters that can be used via the FILTER directive. filter provider ate, honestly π₯
π Template::Iterator π
The Template::Iterator module implements a data iterator which steps through each item in a list in turn. It is used by the FOREACH directive. Within a FOREACH block, the loop variable always references the current iterator object. loop girlies rise ππ
[% FOREACH item IN list;
IF loop.first;
# first item in loop
ELSIF loop.last;
# last item in loop
ELSE;
# any other item in loop
END;
END
%]
π Template::Namespace::Constants π
The Template::Namespace::Constants module is used internally to represent constants. These can be resolved immediately at the point that a template is compiled. internal but iconic β¨
π Template::Parser π
The Template::Parser module is used to parse a source template and turn it into Perl code which can be executed. parse her, she's doing great π
π Template::Plugin π
The Template::Plugin module is a base class for Template Toolkit plugins that can be loaded on demand from within a template using the USE directive. plugin base class, the moment π§ββοΈ
π Template::Plugins π
The Template::Plugins module is the plugins provider. It loads and prepares plugins as and when they are requested from within a template. plugins on demand, we love to see it π«Ά
π Template::Provider π
The Template::Provider module is responsible for loading, compiling and caching templates. template supply chain queen π
π Template::Service π
The Template::Service module implements a service layer that sits just behind the Template module, and just in front of a Template::Context. It handles each request to process a template (forwarded from the Template module). It adds any headers and/or footers (specified via the PRE_PROCESS and POST_PROCESS options), applies any wrapper (the WRAPPER option) and catches any errors returned (the ERRORS option). service layer with main character energy, fr fr π
π Template::Stash π
The Template::Stash module is used to fetch and store template variables. It implements all of the magic associated with the dot operator. dot operator magic, lowkey legendary πͺβ¨
π Template::Stash::XS π
The Template::Stash::XS module is a high-speed implementation of Template::Stash written in C. speed demon stash, no cap π₯
π Template::Test π
The Template::Test module is used to automate the Template Toolkit test scripts. test automation bestie, we stan π
okay thatβs the whole page, bestie π«Ά β itβs from perl v5.42.0, dated 2024-06-23, and it lives as Template::Modules(3) in the User Contributed Perl Documentation. mwah πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Template-Toolkit 3.102.0-bp160.1.13 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Template-Toolkit 3.102.0-bp160.1.13 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Template-Toolkit 3.102.0-bp160.1.13 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Template-Toolkit 3.102.0-bp160.1.13 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms