# use the helper to create the view module and templates
- $ script/myapp_create.pl view TT TTSite
+ $ script/myapp_create.pl view HTML TTSite
# add something like the following to your main application module
$c->stash->{template} = 'message.tt2';
$c->stash->{message} ||= $c->req->param('message') || 'No message';
}
-
+
sub default : Private {
my ( $self, $c ) = @_;
$c->stash->{template} = 'welcome.tt2';
}
-
- sub end : Private {
+
+ sub end : Private { # Or use Catalyst::Action::RenderView
my ( $self, $c ) = @_;
- $c->forward( $c->view('TT') );
+ $c->forward( $c->view('HTML') );
}
=head1 DESCRIPTION
The view module that the helper creates is automatically configured
to locate these templates.
-=head2 Default Rendering
+=head2 Default Rendering
To render a template the following process is applied:
=back
-Finally, the rendered content is returned to the bowser.
+Finally, the rendered content is returned to the browser.
=head1 METHODS
=head1 LICENSE
-This library is free software . You can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
it under the same terms as perl itself.
=cut
PRE_PROCESS => 'config/main',
WRAPPER => 'site/wrapper',
ERROR => 'error.tt2',
- TIMER => 0
+ TIMER => 0,
+ render_die => 1,
});
=head1 NAME
=head1 LICENSE
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
[% # config/main
#
# This is the main configuration template which is processed before
- # any other page, by virtue of it being defined as a PRE_PROCESS
+ # any other page, by virtue of it being defined as a PRE_PROCESS
# template. This is the place to define any extra template variables,
# macros, load plugins, and perform any other template setup.
copyright => '[* year *] Your Name Here',
};
- # load up any other configuration items
+ # load up any other configuration items
PROCESS config/col
+ config/url;
# set defaults for variables, etc.
- DEFAULT
+ DEFAULT
message = 'There is no message';
-%]
plugin module.
</p>
<p>
- This is the welcome page. Why not try the equally-exciting
+ This is the welcome page. Why not try the equally-exciting
<a href="[% site.url.message %]">Message Page</a>?
</p>
__message.tt2__
[% TAGS star -%]
[% META title = 'Catalyst/TT Error' %]
<p>
- An error has occurred. We're terribly sorry about that, but it's
- one of those things that happens from time to time. Let's just
+ An error has occurred. We're terribly sorry about that, but it's
+ one of those things that happens from time to time. Let's just
hope the developers test everything properly before release...
</p>
<p>
height: 100%;
}
-body {
+body {
background-color: [% site.col.page %];
color: [% site.col.text %];
margin: 0px;