.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" 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 "CGI::Application::Plugin::TT::LastModified 3pm" .TH CGI::Application::Plugin::TT::LastModified 3pm "2023-01-15" "perl v5.36.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" CGI::Application::Plugin::TT::LastModified \- Set "Last\-Modified" header based on TT template .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& # when you want to set the "Last\-Modified" header manually \& use base qw(CGI::Application); \& use CGI::Application::Plugin::TT; \& use CGI::Application::Plugin::TT::LastModified; \& \& sub my_runmode { \& my $self = shift; \& my %params = ( \& # ... \& ); \& my $html = $self\->tt_process( \*(Aqtemplate.html\*(Aq, \e%params ); \& $self\->tt_set_last_modified_header(); \& return $html; \& } \& \& # when you want the "Last\-Modified" header set automatically \& use base qw(CGI::Application); \& use CGI::Application::Plugin::TT; \& use CGI::Application::Plugin::TT::LastModified qw(:auto); \& \& sub my_runmode { \& my $self = shift; \& my %params = ( \& # ... \& ); \& return $self\->tt_process( \*(Aqtemplate.html\*(Aq, \e%params ); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`CGI::Application::Plugin::TT::LastModified\*(C'\fR adds support to \&\f(CW\*(C`CGI::Application\*(C'\fR for setting a \*(L"Last-Modified\*(R" header based on the most recent modification time of \fIany\fR of the components of a template that was processed with \s-1TT.\s0 .PP Normally you'll want to call it manually, on as \*(L"as needed\*(R" basis; if you're processing templates with \s-1TT\s0 you're most likely dealing with dynamic content (in which case you probably don't even want a \*(L"Last-Modified\*(R" header). The odd time you'll want to set a \*(L"Last-Modified\*(R" header, though, this plugin helps make that easier. .PP \&\fBIf\fR you have a desire to have the \*(L"Last-Modified\*(R" header set automatically for you, though, \f(CW\*(C`CGI::Application::Plugin::TT::LastModified\*(C'\fR does have an \&\f(CW\*(C`:auto\*(C'\fR import tag which auto-registers \*(L"\fBtt_set_last_modified_header()\fR\*(R" as a \&\*(L"tt_post_process\*(R" hook for you. If you've got an app that just processes static \s-1TT\s0 pages and generates output, this will be useful for you. .SH "METHODS" .IX Header "METHODS" .IP "\fBimport()\fR" 4 .IX Item "import()" Custom import routine, which allows for \f(CW\*(C`tt_set_last_modified_header()\*(C'\fR to be auto-added in as a \s-1TT\s0 post process hook. .IP "\fBtt_last_modified()\fR" 4 .IX Item "tt_last_modified()" Returns the most recent modification time for any component of the most recently processed template (via \f(CW\*(C`tt_process()\*(C'\fR). Time is returned back to the caller as \*(L"the number of seconds since the epoch\*(R". .IP "\fBtt_set_last_modified_header()\fR" 4 .IX Item "tt_set_last_modified_header()" Sets a \*(L"Last-Modified\*(R" header in the \s-1HTTP\s0 response, equivalent to the last modification time of the template components as returned by \&\f(CW\*(C`tt_last_modified()\*(C'\fR. .SH "AUTHOR" .IX Header "AUTHOR" Graham TerMarsch (cpan@howlingfrog.com) .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2007, Graham TerMarsch. All Rights Reserved. .PP This is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "CGI::Application::Plugin::TT" 4 .IX Item "CGI::Application::Plugin::TT" .PD 0 .IP "CGI::Application" 4 .IX Item "CGI::Application" .IP "Template" 4 .IX Item "Template"