Catalyst::View::HTML::Template - HTML::Template View Class
# 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');
This is the HTML::Template view class. Your subclass should inherit from this class.
HTML::Template
Renders the template specified in $c->stash->{template} or $c->request->match. Template params are set up from the contents of $c->stash, augmented with base set to $c->req->base and name to $c->config->{name}. Output is stored in $c->response->body.
$c->stash->{template}
$c->request->match
$c->stash
base
$c->req->base
name
$c->config->{name}
$c->response->body
Renders the given template and returns output. Template params are set up either from the contents of %$args if $args is a hashref, or $c->stash, augmented with base set to $c->req->base and name to $c->config->{name}.
%$args
This allows your view subclass to pass additional settings to the HTML::Template config hash.
HTML::Template, Catalyst, Catalyst::Base.
Christian Hansen, ch@ngmedia.com
ch@ngmedia.com
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::View::HTML::Template, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::View::HTML::Template
CPAN shell
perl -MCPAN -e shell install Catalyst::View::HTML::Template
For more information on module installation, please visit the detailed CPAN module installation guide.