Cataly...mplate(3pm)
π 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 withbaseset to$c->req->baseandnameset 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%$argsif$argsis a hashref, or from$c->stash, again augmented withbaseset to$c->req->baseandnameset 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 π«‘
π COPYRIGHT π
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
- fedora 43: perl-Catalyst-View-HTML-Template 0.03-42.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms