CGI::A...ateExpr(3pm)
π NAME π
CGI::Application::Plugin::AnyTemplate::Driver::HTMLTemplateExpr β bestie, this is the HTML::Template::Expr driver for AnyTemplate. It's a User Contributed Perl Documentation page (that's the 3pm section, iykyk π).
πΈ DESCRIPTION πΈ
Okay so. This is a driver for CGI::Application::Plugin::AnyTemplate, and what it does is hand over the implementation details specific to rendering templates via the HTML::Template::Expr templating system. It's giving backstage crew energy π
All the "AnyTemplate" drivers are designed to be used the exact same way. For the general usage instructions, go read the docs of CGI::Application::Plugin::AnyTemplate. No notes, it's all there π«Ά
π¦ EMBEDDED COMPONENT SYNTAX (HTML::Template::Expr) π¦
β¨ Syntax β¨
The HTML::Template::Expr syntax for embedding components is literally this:
<TMPL_VAR EXPR="CGIAPP_embed('some_run_mode', param1, param2, 'literal string3')">
And you can override that with these configuration variables:
embed_tag_name # default 'CGIAPP_embed'
So say you set this value in your configuration file:
embed_tag_name '__ACME_render'
Then your embedded component tag is gonna look like:
<TMPL_VAR EXPR="__ACME_render('some_run_mode')">
β οΈ Heads up bestie: the value ofembed_tag_namemust consist of numbers, letters and underscores (_), and must not begin with a number. That's the vibe check, don't fail it π
π CONFIGURATION π
The CGI::Application::Plugin::AnyTemplate::Driver::HTMLTemplateExpr driver accepts these config parameters, no cap:
embed_tag_nameβ the name of the tag used for embedding components. Defaults toCGIAPP_embed. Cute, right? β¨template_extensionβ ifauto_add_template_extensionis true, thenCGI::Application::Plugin::AnyTemplatewill append the value oftemplate_extensiontofilename. By default thetemplate_extensionis.html. Periodt. πassociate_queryβ okay so, this feature is now deprecated and will be removed in a future release. Not me warning you π«
If this config parameter is true, then CGI::Application::Plugin::AnyTemplate::Driver::HTMLTemplateExpr will copy all of the webapp's query params into the template using HTML::Template::Expr's associate mechanism:
my $driver = HTML::Template::Expr->new(
associate => $self->query,
);
By default associate_query is false.
And lowkey important: if you provide an associate config parameter of your own, that will disable the associate_query functionality. They can't both be main character, sorry π
All other configuration parameters are passed on unchanged to HTML::Template::Expr. Slay.
π required_modules π
The required_modules function returns the modules required for this driver to operate. In this case: HTML::Template::Expr. That's the whole roster, iconic π
π DRIVER METHODS π
initializeβ initializes theHTMLTemplateExprdriver. See the docs forCGI::Application::Plugin::AnyTemplate::Basefor details. π§render_templateβ fills theHTML::Template::Exprobject with$self->param, and returns the output (as a string reference). See the docs forCGI::Application::Plugin::AnyTemplate::Basefor details. Literally obsessed with how simple that is π
π₯ SEE ALSO π₯
CGI::Application::Plugin::AnyTemplateCGI::Application::Plugin::AnyTemplate::BaseCGI::Application::Plugin::AnyTemplate::ComponentHandlerCGI::Application::Plugin::AnyTemplate::Driver::HTMLTemplateCGI::Application::Plugin::AnyTemplate::Driver::HTMLTemplatePluggableCGI::Application::Plugin::AnyTemplate::Driver::TemplateToolkitCGI::Application::Plugin::AnyTemplate::Driver::PetalCGI::ApplicationTemplate::ToolkitHTML::TemplateHTML::Template::PluggableHTML::Template::Plugin::DotPetalExporter::RenamingCGI::Application::Plugin::TT
π AUTHOR π
Michael Graham, "<mgraham@cpan.org>" β thank you king π«Ά
β COPYRIGHT & LICENSE β
Copyright 2005 Michael Graham, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Fr fr, that's the whole license, go wild (responsibly) πΈ
Okay bestie, that's the whole page! This one came from perl v5.30.3, dated 2020-10-26, and the man page it lives in is CGI::A...ateExpr(3pm). Go forth and render those templates, you absolute icon π
β¨
π¦ where this page comes from
- debian bookworm: libcgi-application-plugin-anytemplate-perl 0.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcgi-application-plugin-anytemplate-perl 0.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libcgi-application-plugin-anytemplate-perl 0.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcgi-application-plugin-anytemplate-perl 0.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcgi-application-plugin-anytemplate-perl 0.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcgi-application-plugin-anytemplate-perl 0.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms