Cataly...mplate(3pm)

πŸ“¦
version 0.03 Β· 2 versions
, in fedora 43

πŸ’– Cataly...mplate(3pm) β€” bestie edition πŸ’–

okay so you found the manual page for Cataly...mplate(3pm) and honestly? it's a little one but it's important, so sit down, grab a strawberry, and let's go πŸ“


✨ NAME ✨

Catalyst::View::HTML::Template β€” the HTML::Template View Class. that's it, that's the name, she's serving exactly what it says on the tin πŸ’…


🌸 SYNOPSIS 🌸

here's the whole vibe, copy-paste ready:

# use the helper
create.pl view HTML::Template HTML::Template

# lib/MyApp/View/HTML/Template.pm
package MyApp::View::HTML::Template;

use base 'Catalyst::View::HTML::Template';

__PACKAGE__->config(
    die_on_bad_params => 0,
    file_cache        => 1,
    file_cache_dir    => '/tmp/cache'
);

1;

# Meanwhile, maybe in an 'end' action
$c->forward('MyApp::View::HTML::Template');

so like, you spin up the view with the helper, you make your little subclass, you configure it, and then you forward to it β€” maybe from an end action β€” and boom, rendered. iconic ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

this right here is the HTML::Template view class. and the way this works is: your subclass should inherit from this class. that's the assignment, no cap. no inheritance, no slay 🫢

πŸ’œ METHODS πŸ’œ

  • process β€” renders the template that's specified in $c->stash->{template} or in $c->request->match. the template params get set up from the contents of $c->stash, and then they're augmented with base set to $c->req->base and name set to $c->config->{name}. the output lands in $c->response->body. that's the whole journey bestie, stash in, body out πŸ’–
  • render β€” renders the given template and returns the output. template params come either from the contents of %$args if $args is a hashref, or from $c->stash, again augmented with base set to $c->req->base and name set to $c->config->{name}. so like, two paths, one glow-up 🌈
  • config β€” this is the one that lets your view subclass pass extra settings into the HTML::Template config hash. your config, your rules, main character energy πŸ‘‘

🌟 SEE ALSO 🌟

HTML::Template, Catalyst, Catalyst::Base. go read those too, iykyk πŸ“š


πŸŽ€ AUTHOR πŸŽ€

Christian Hansen, ch@ngmedia.com β€” ty for your service, legend 🫑


this program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. fr fr, go wild πŸ¦‹


and that's the whole page, bestie! no notes, she ate πŸ’…

okay so the tea at the bottom of the page: this was built with perl v5.42.0 and dated 2025-07-25. mwah, bye!! πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from