logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Text::Hogan::Template - represent and render compiled templates

Authors

       Started out statement-for-statement copied from hogan.js by Twitter!

       Initial translation by Alex Balhatchet (alex@balhatchet.net)

       Further improvements from:

       Ed Freyfogle Mohammad S Anwar Ricky Morse Jerrad Pierce Tom Hukins Tony Finch Yanick Champoux

perl v5.34.0                                       2022-06-30                         Text::Hogan::Template(3pm)

Name

       Text::Hogan::Template - represent and render compiled templates

Synopsis

       Use Text::Hogan::Compiler to create Template objects.

       Then call render passing in a hashref for context.

           use Text::Hogan::Compiler;

           my $template = Text::Hogan::Compiler->new->compile("Hello, {{name}}!");

           say $template->render({ name => $_ }) for (qw(Fred Wilma Barney Betty));

       Optionally takes a hashref of partials.

           use Text::Hogan::Compiler;

           my $template = Text::Hogan::Compiler->new->compile("{{>hello}}");

           say $template->render({ name => "Dino" }, { hello => "Hello, {{name}}!" });

Version

       version 2.03

See Also