2 Catalyst::View::TT - Template View Class
9 package MyApp::View::TT;
11 use base 'Catalyst::View::TT';
13 __PACKAGE__->config->{DEBUG} = 'all';
17 # Meanwhile, maybe in an '!end' action
18 $c->forward('MyApp::View::TT');
21 This is the "Template" view class. Your subclass should inherit from
22 this class. The plugin renders the template specified in
23 "$c->stash->{template}" or "$c->request->match". The template variables
24 are set up from the contents of "$c->stash", augmented with "base" set
25 to "$c->req->base", "c" to $c and "name" to "$c->config->{name}". The
26 output is stored in "$c->response->output".
28 If you want to override TT config settings, you can do it there by
29 setting "__PACKAGE__->config->{OPTION}" as shown in the synopsis. Of
30 interest might be "EVAL_PERL", which is disabled by default, and
31 "LOAD_TEMPLATES", which is set to use the provider.
33 If you want to use EVAL perl, add something like this:
35 __PACKAGE__->config->{EVAL_PERL} = 1;
36 __PACKAGE__->config->{LOAD_TEMPLATES} = undef;
38 If you have configured Catalyst for debug output "Catalyst::View::TT"
39 will enable profiling of template processing (using "Template::Timer".
40 This will cause HTML comments will get embedded in the output from your
43 <!-- TIMER START: process mainmenu/mainmenu.ttml -->
44 <!-- TIMER START: include mainmenu/cssindex.tt -->
45 <!-- TIMER START: process mainmenu/cssindex.tt -->
46 <!-- TIMER END: process mainmenu/cssindex.tt (0.017279 seconds) -->
47 <!-- TIMER END: include mainmenu/cssindex.tt (0.017401 seconds) -->
51 <!-- TIMER END: process mainmenu/footer.tt (0.003016 seconds) -->
53 You can supress template profiling when debug is enabled by setting:
55 __PACKAGE__->config->{CONTEXT} = undef;
59 Renders the template specified in "$c->stash->{template}" or
60 "$c->request->match". Template variables are set up from the contents of
61 "$c->stash", augmented with "base" set to "$c->req->base", "c" to $c and
62 "name" to "$c->config->{name}". Output is stored in
63 "$c->response->output".
66 This allows your view subclass to pass additional settings to the TT
73 Sebastian Riedel, "sri@cpan.org" Marcus Ramberg, "mramberg@cpan.org"
76 This program is free software, you can redistribute it and/or modify it
77 under the same terms as Perl itself.