| Catalyst-Enzyme documentation | Contained in the Catalyst-Enzyme distribution. |
Catalyst::Helper::View::Enzyme::TT - Helper for Enzyme::TT Views
script/create.pl view TT Enzyme::TT
Helper for Enzyme::TT Views.
Copy the file at basename($file_source_base)/$subdir_source/$file_source_name into the application dir/$file_target_name.
Johan Lindstrom, johanl ÄT cpan.org
This library is free software . You can redistribute it and/or modify it under the same terms as perl itself.
[% class %] - Catalyst Catalyst::Enzyme::CRUD::View TT View
See [% app %]
Catalyst TT View with Catalyst::View::TT::ControllerLocal and Catalyst::Enzyme::CRUD::View CRUD support.
[% author %]
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
| Catalyst-Enzyme documentation | Contained in the Catalyst-Enzyme distribution. |
package Catalyst::Helper::View::Enzyme::TT; our $VERSION = '0.10'; use strict; use Data::Dumper; use File::Basename; use File::Path; use Path::Class; use File::Slurp;
sub mk_compclass { my ( $self, $helper ) = @_; my $file = $helper->{file}; $helper->render_file( 'compclass', $file ); for my $template ( qw/ add.tt edit.tt footer.tt form_macros.tt header.tt list.tt list_macros.tt pager.tt pager_macros.tt view.tt view_macros.tt delete.tt /) { $self->cp_local_file($helper, __FILE__, "TT", "root/base/$template"); } $self->cp_local_file($helper, __FILE__, "TT", "root/static/css/enzyme.css", "root/static/css/" . lc("$helper->{app}.css")); }
sub cp_local_file { my ($self, $helper, $file_source_base, $subdir_source, $file_source_name, $file_target_name) = @_; $file_target_name ||= $file_source_name; my $dir_source = dir( dirname($file_source_base), $subdir_source ); my $file_source = file($dir_source, $file_source_name); my $text_source = read_file("$file_source"); my $file_target = file($helper->{'base'}, $file_target_name); mkpath(dirname($file_target)); $helper->mk_file($file_target, $text_source); }
1; __DATA__ __compclass__ package [% class %]; use strict; use base qw/ Catalyst::View::TT::ControllerLocal Catalyst::Enzyme::CRUD::View /;
1;