sub mk_templates {
my ( $self, $helper ) = @_;
- my $base = $helper->{base};
- my $tdir = File::Spec->catfile( $base, 'root', 'templates' );
- my $ldir = File::Spec->catfile( $tdir, 'lib' );
- my $sdir = File::Spec->catfile( $tdir, 'src' );
+ my $base = $helper->{base},;
+ my $ldir = File::Spec->catfile( $base, 'root', 'lib' );
+ my $sdir = File::Spec->catfile( $base, 'root', 'src' );
$helper->mk_dir($ldir);
$helper->mk_dir($sdir);
sub message : Global {
my ( $self, $c ) = @_;
$c->stash->{template} = 'message.tt2';
- $c->stash->{message} = $c->req->param('message') || 'Hello World';
+ $c->stash->{message} ||= $c->req->param('message') || 'No message';
}
sub default : Private {
use strict;
use base 'Catalyst::View::TT';
-my $root = [% app %]->config->{root};
-
__PACKAGE__->config({
CATALYST_VAR => 'Catalyst',
- INCLUDE_PATH => [ "$root/templates/src", "$root/templates/lib" ],
+ INCLUDE_PATH => [
+ MyApp->path_to( 'root', 'src' )
+ MyApp->path_to( 'root', 'lib' )
+ ],
PRE_PROCESS => 'config/main',
WRAPPER => 'site/wrapper',
ERROR => 'error.tt2',
=head1 NAME
-[% class %] - TT View Component
+[% class %] - Catalyst TTSite View
=head1 SYNOPSIS
=head1 DESCRIPTION
-TT View Component.
+Catalyst TTSite View.
=head1 AUTHOR
=head1 LICENSE
-This library is free software . You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut