Templa...y::Tmpl(3pm)

πŸ“¦
version 1.022 Β· 6 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Template::Alloy::Tmpl β€” it's the Text::Tmpl role, bestie πŸ’– (from the Template::Alloy family, Perl's user-contributed docs, 3pm energy)


πŸ’… DESCRIPTION πŸ’…

Okay so Template::Alloy::Tmpl is a role that hands you the syntax and the interface for Text::Tmpl. Not just that though β€” it also pulls in a whole bunch of features from the various other templating systems out there. It's giving ✨multiverse of template engines✨.

For configuration and all the other parameters, go read the Template::Alloy documentation, mkay? 🫢


πŸŽ€ ROLE_METHODS πŸŽ€

  • parse_tree_tmpl β€” this one gets called by parse_tree when the syntax is set to tmpl. It parses for tags, Text::Tmpl style. Periodt. πŸ”₯
  • set_delimiters β€” sets the START_TAG and END_TAG that parsing is gonna use. Slay:
$obj->set_delimiters('#[', ']#');
  • strerror β€” use this to check the error when a compile fails (or honestly you can just use ->error, whatever vibes πŸ’). Can be called as a function or as a method β€” and heads up, Text::Tmpl only allows it as a function. iykyk.
  • set_strip β€” decides whether trailing whitespace on the same line gets removed. Default is false. No cap.
  • set_dir β€” sets the path where included templates get looked for. πŸ¦‹
  • set_value β€” sets a single value that's used while the template is being processed. One value, one moment, main character energy:
$obj->set_value(key => $value);
  • set_values β€” sets multiple values for use during processing. Bring the whole group chat:
$obj->set_values(\%values);
  • parse_string β€” processes the string you pass in. Literally just hand it a string and watch it go 🌸:
my $out = $obj->process_string("#[echo $foo]#");
  • parse_file β€” processes the filename you pass in. Same deal but it's a file bestie:
my $out = $obj->process_file("my/file.tmpl");
  • loop_iteration β€” same as the Text::Tmpl method β€” it's for adding iterations to a loop. Loops are lowkey iconic:
my $ref = $obj->loop_iteration('loop1'); # creates iteration 0
$ref->set_values($hash);
  • fetch_loop_iteration β€” grabs a loop iteration that was created earlier, like finding the message you forgot to reply to πŸ™ˆ:
my $ref = $obj->fetch_loop_iteration('loop1', 0);
$ref->set_values($hash);

πŸ’€ UNSUPPORTED Text::Tmpl METHODS πŸ’€

Not these. They're not supported, so don't come for me. πŸ’€

register_simple, register_pair, alias_simple, alias_pair, remove_simple, remove_pair, set_debug, errno


πŸ‘‘ AUTHOR πŸ‘‘

Paul Seamons <paul@seamons.com> β€” the author, the moment, the icon ✨


🌈 LICENSE 🌈

This module may be distributed under the same terms as Perl itself. Fr fr.


That's the whole page, bestie β€” no notes, you ate. πŸ’… This was perl v5.38.2, dated 2024-03-07, and it's the Templa...y::Tmpl(3pm) page, so now you're fully caught up. Mwah πŸŽ€πŸ’–

πŸ“¦ where this page comes from