Catalyst::Helper::View::TTSite - Helper for TT view which builds a skeleton web site
# use the helper to create the view module and templates
$ script/myapp_create.pl view TT TTSite
# add something like the following to your main application module
sub message : Global { my ( $self, $c ) = @_; $c->stash->{template} = 'message.tt2'; $c->stash->{message} = $c->req->param('message') || 'Hello World'; } sub default : Private { my ( $self, $c ) = @_; $c->stash->{template} = 'welcome.tt2'; } sub end : Private { my ( $self, $c ) = @_; $c->forward('MyApp::V::TT'); }
This helper module creates a TT View module. It goes further than Catalyst::Helper::View::TT in that it additionally creates a simple set of templates to get you started with your web site presentation.
It creates the templates in a templates directory underneath your main project directory. In here two further subdirectories are created: src which contains the main page templates, and lib containing a library of other templates components (header, footer, etc.) that the page templates use.
The view module that the helper creates is automatically configured to locate these templates.
Generates the component class.
Generates the templates.
Catalyst, Catalyst::View::TT, Catalyst::Helper, Catalyst::Helper::View::TT
Andy Wardley <abw@cpan.org>
This library is free software . You can redistribute it and/or modify it under the same terms as perl itself.
[% class %] - TT View Component
See "[% app %]"
TT View Component.
[% author %]
To install Catalyst::View::TT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::View::TT
CPAN shell
perl -MCPAN -e shell install Catalyst::View::TT
For more information on module installation, please visit the detailed CPAN module installation guide.