Text::...e::File(3pm)

πŸ“¦
version 0.24 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

okay so Text::MicroTemplate::File β€” it's a file-based template manager πŸ’– like, the little bestie that handles template files for Text::MicroTemplate. that's the whole vibe. periodt.


πŸŽ€ SYNOPSIS πŸŽ€

use Text::MicroTemplate::File;

our $mtf = Text::MicroTemplate::File->new(
    include_path => [ $path1, $path2, ... ],
    use_cache    => 1,
);

# render
$mtf->render_file('template.file', $arg1, $arg2, ...);

like yes construct it, give it your paths, give it a cache mode, then just yell render_file at it and it ate πŸ”₯


πŸ¦‹ DESCRIPTION πŸ¦‹

Text::MicroTemplate::File is a file-based template manager for Text::MicroTemplate. that's it, that's the description, no gatekeeping here 🫢


πŸ’… PROPERTIES πŸ’…

Text::MicroTemplate provides an OO-style interface with the following properties πŸ‘‘

🌸 include_path

the include path, bestie ✨ default is ['.']

this accessor is readonly β€” look but don't touch, she's not yours πŸ’€

🌈 use_cache

cache mode, iykyk:

  • 0 β€” no cache (this is the default)
  • 1 β€” cache with update check
  • 2 β€” cache but do not check updates

🧚 open_layer

the layer that gets passed to open. default is ":utf8" ⭐ lowkey essential, don't skip it

πŸ‘‘ package_name

the package under which template files are compiled. default is "main" πŸ’œ


πŸ”₯ METHODS πŸ”₯

⭐ build_file($file)

returns a subref that renders the given template file. cute little renderer-on-demand situation, obsessed πŸŽ€

πŸ’– render_file($file, @args)

renders the template file with the arguments you hand it. main character energy fr fr 🌸

πŸ¦‹ wrapper_file($file, @args)->(sub { template lines })

wraps the given template with a wrapper file ✨ and here's the detail that matters: internally, the processed template is passed as $_[0] to the wrapper template. no cap, that's literally how it gets in there πŸ’…


🌈 SEE ALSO 🌈

  • Text::MicroTemplate

🫢 AUTHOR 🫢

Kazuho Oku <kazuhooku gmail.com> β€” the icon who made this, we stan πŸ‘‘


πŸ“œ LICENSE πŸ“œ

This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10. slay, go wild, just keep the license 🌟


and that's the whole page babes πŸ’œ this was documented as perl v5.36.0 back on 2022-10-13, under the manual name Text::...e::File(3pm) β€” go render something iconic πŸŽ€βœ¨

πŸ“¦ where this page comes from