.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Catalyst::Helper::View::TTSite 3pm" .TH Catalyst::Helper::View::TTSite 3pm "2022-08-06" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Catalyst::Helper::View::TTSite \- Helper for TT view which builds a skeleton web site .SH "SYNOPSIS" .IX Header "SYNOPSIS" # use the helper to create the view module and templates .PP .Vb 1 \& $ script/myapp_create.pl view HTML TTSite .Ve .PP # add something like the following to your main application module .PP .Vb 5 \& sub message : Global { \& my ( $self, $c ) = @_; \& $c\->stash\->{template} = \*(Aqmessage.tt2\*(Aq; \& $c\->stash\->{message} ||= $c\->req\->param(\*(Aqmessage\*(Aq) || \*(AqNo message\*(Aq; \& } \& \& sub default : Private { \& my ( $self, $c ) = @_; \& $c\->stash\->{template} = \*(Aqwelcome.tt2\*(Aq; \& } \& \& sub end : Private { # Or use Catalyst::Action::RenderView \& my ( $self, $c ) = @_; \& $c\->forward( $c\->view(\*(AqHTML\*(Aq) ); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This helper module creates a \s-1TT\s0 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. .PP It creates the templates in \fIroot/\fR directory underneath your main project directory. In here two further subdirectories are created: \fIroot/src\fR which contains the main page templates, and \fIroot/lib\fR containing a library of other template components (header, footer, etc.) that the page templates use. .PP The view module that the helper creates is automatically configured to locate these templates. .SS "Default Rendering" .IX Subsection "Default Rendering" To render a template the following process is applied: .PP The configuration template \fIroot/lib/config/main\fR is rendered. This is controlled by the \f(CW\*(C`PRE_PROCESS\*(C'\fR configuration variable set in the controller generated by Catalyst::Helper::View::TTsite. Additionally, templates referenced by the \f(CW\*(C`PROCESS\*(C'\fR directive will then be rendered. By default the following additional templates are set: \fIroot/lib/config/col\fR, which defines color names and \s-1RGB\s0 their \s-1RGB\s0 values and \fI/root/lib/config/url\fR, which defines site wide variables available to templates. .PP Next, the template defined by the \f(CW\*(C`WRAPPER\*(C'\fR config variable is called. The default wrapper template is located in \fIroot/lib/site/wrapper\fR. The wrapper template passes files with \f(CW\*(C`.css/.js/.txt\*(C'\fR extensions through as text \s-1OR\s0 processes the templates defined after the \f(CW\*(C`WRAPPER\*(C'\fR directive: \f(CW\*(C`site/html\*(C'\fR and \f(CW\*(C`site/layout\*(C'\fR. .PP Based on the default value of the \f(CW\*(C`WRAPPER\*(C'\fR directive in \fIroot/lib/site/wrapper\fR, the following templates are processed in order: .IP "\(bu" 4 \&\fIroot/src/your_template.tt2\fR .IP "\(bu" 4 \&\fIroot/lib/site/footer\fR .IP "\(bu" 4 \&\fIroot/lib/site/header\fR .IP "\(bu" 4 \&\fIroot/lib/site/layout\fR .IP "\(bu" 4 \&\fIroot/lib/site/html\fR .PP Finally, the rendered content is returned to the browser. .SH "METHODS" .IX Header "METHODS" .SS "mk_compclass" .IX Subsection "mk_compclass" Generates the component class. .SS "mk_templates" .IX Subsection "mk_templates" Generates the templates. .SH "SEE ALSO" .IX Header "SEE ALSO" Catalyst, Catalyst::View::TT, Catalyst::Helper, Catalyst::Helper::View::TT .SH "AUTHOR" .IX Header "AUTHOR" Andy Wardley .SH "LICENSE" .IX Header "LICENSE" This library is free software. You can redistribute it and/or modify it under the same terms as perl itself. .SH "NAME" [% class %] \- Catalyst TTSite View .SH "SYNOPSIS" .IX Header "SYNOPSIS" See \*(L"[% app %]\*(R" .SH "DESCRIPTION" .IX Header "DESCRIPTION" Catalyst TTSite View. .SH "AUTHOR" .IX Header "AUTHOR" [% author %] .SH "LICENSE" .IX Header "LICENSE" This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.