X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FHelper%2FView%2FTT.pm;h=ecaa472edfc47e2ea5b5fb956c08eff527fd6528;hb=d318f193ec999438a07248436ba1866868fd089f;hp=6781e514d029c0546ff793c90df2204f372b992b;hpb=8077080cf3b7ce19c6604817d7687352790e77e4;p=catagits%2FCatalyst-View-TT.git diff --git a/lib/Catalyst/Helper/View/TT.pm b/lib/Catalyst/Helper/View/TT.pm index 6781e51..ecaa472 100644 --- a/lib/Catalyst/Helper/View/TT.pm +++ b/lib/Catalyst/Helper/View/TT.pm @@ -1,7 +1,9 @@ package Catalyst::Helper::View::TT; use strict; -use IO::File; + +our $VERSION = '0.44'; +$VERSION = eval $VERSION; =head1 NAME @@ -9,7 +11,7 @@ Catalyst::Helper::View::TT - Helper for TT Views =head1 SYNOPSIS - bin/create view TT TT + script/create.pl view HTML TT =head1 DESCRIPTION @@ -23,55 +25,63 @@ Helper for TT Views. sub mk_compclass { my ( $self, $helper ) = @_; - my $file = $helper->{file}; - my $class = $helper->{class}; - my $comp = IO::File->new("> $file") or die qq/Couldn't open "$file", "$!"/; - print $comp <<"EOF"; -package $class; + my $file = $helper->{file}; + $helper->render_file( 'compclass', $file ); +} -use strict; -use base 'Catalyst::View::TT'; +=head1 SEE ALSO -=head1 NAME +L, L, L, +L, L -$class - TT View Component +=head1 AUTHOR -=head1 SYNOPSIS +Sebastian Riedel, C +Marcus Ramberg, C - Very simple to use +=head1 LICENSE -=head1 DESCRIPTION +This library is free software . You can redistribute it and/or modify +it under the same terms as perl itself. -Very nice component. +=cut -=head1 AUTHOR +1; -Clever guy +__DATA__ -=head1 LICENSE +__compclass__ +package [% class %]; +use Moose; +use namespace::autoclean; -This library is free software . You can redistribute it and/or modify it under -the same terms as perl itself. +extends 'Catalyst::View::TT'; -=cut +__PACKAGE__->config( + TEMPLATE_EXTENSION => '.tt', + render_die => 1, +); -1; -EOF -} +=head1 NAME + +[% class %] - TT View for [% app %] + +=head1 DESCRIPTION + +TT View for [% app %]. =head1 SEE ALSO -L, L, L, -L, L +L<[% app %]> =head1 AUTHOR -Sebastian Riedel, C +[% 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