- or download this
The render method uses the results from engine and template to
process a selected template through Template Toolkit.
- or download this
render ($engine, $template)
- or download this
sub render {
my $self = shift;
...
or die $tt->error; # passes Template::Exception upward
$self->display($output);
}
- or download this
sub template {
'[% self.CGI.header %]This page intentionally left blank.';
}
- or download this
Called when a page gains control, either at the beginning for a
response, or in the middle when switched for rendering. Defaults to
+
nothing.
- or download this
sub dispatch {
my $self = shift;
$self->param('rm') eq 'Webmail' and return 'Local::Page::Webmail' ;
return 'Local::Page::Welcome';
}
- or download this
sub activate {
my $self = shift;
...
};
$self->error($@) if $@; # failed something, go to safe mode
}
- or download this
our $_mirror = __PACKAGE__->reflect; # for slots that aren't subs
- or download this
$_mirror->addSlot
([qw(CGI FIELD autoload)] => sub { # must be reset in mod_perl
require CGI;
CGI->new;
});
- or download this
$_mirror->addSlot
([qw(engine FIELD autoload)] => sub {
...
require Template;
Template->new or die "Creating tt: $Template::ERROR\n";
+
});
- or download this
app_enter app_leave control_enter control_leave
render_enter render_leave respond_enter respond_leave
- or download this
#!/usr/bin/perl
...
warn $o->display('hi');
CGI::Prototype->activate;