.\" 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 "HTML::Template::Compiled::Reference 3pm" .TH HTML::Template::Compiled::Reference 3pm "2022-11-19" "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" HTML::Template::Compiled::Reference \- A quick reference for HTML::Template::Compiled syntax .SH "TAGSTYLES" .IX Header "TAGSTYLES" .Vb 3 \& \& \& <%if var %><%= foo %><%/if var %> .Ve .PP Optional tagstyle 'tt': .PP .Vb 1 \& [%if var %][%= foo %][%/if var %] .Ve .SH "ACCESSING VARIABLES" .IX Header "ACCESSING VARIABLES" .Vb 3 \& <%= _.foo %> \& outputs foo in the cuurent position of the stash and is the same as \& <%= foo %> \& \& <%= .config.url %> \& goes to root of parameter stash; like $params\->{config}\->{url} \& \& <%= ..foo %> \& goes one level up in stash \& \& <%= list[3].keyname.method %> \& acts like: $stash\->[3]\->{keyname}\->method .Ve .SH "TAGS" .IX Header "TAGS" .IP "\s-1VAR\s0" 4 .IX Item "VAR" .Vb 1 \& <%var foo%> or <%= foo%> .Ve .IP "\s-1IF, IF_DEFINED, UNLESS, ELSIF, ELSE\s0" 4 .IX Item "IF, IF_DEFINED, UNLESS, ELSIF, ELSE" conditions like in Perl .IP "\s-1LOOP, WHILE, EACH\s0" 4 .IX Item "LOOP, WHILE, EACH" for-loop and while-loop like in Perl. .Sp .Vb 7 \& <%loop cds%><%= _\|_counter_\|_%>. Title: <%= _.title%><%/loop cds%> \& <%loop cds join=", " %><%= _.title%><%/loop cds%> \& <%while resultset.next%><%= _\|_counter_\|_%>. <%= _.foo %><%/while %> \& <%each hashref%><%= _\|_key_\|_ %>=<%= _\|_value_\|_ %><%/each %> (sorted alphanumeric) \& <%each hashref sort=alpha %><%= _\|_key_\|_ %>=<%= _\|_value_\|_ %><%/each %> (sorted alphanumeric) \& <%each hashref sort=num %><%= _\|_key_\|_ %>=<%= _\|_value_\|_ %><%/each %> (sorted numeric) \& <%each hashref sort=0 %><%= _\|_key_\|_ %>=<%= _\|_value_\|_ %><%/each %> (not sorted) .Ve .IP "\s-1WITH\s0" 4 .IX Item "WITH" .Vb 1 \& <%with cds[0].artist.fanclub%><%= _.address%><%= _.homepage%><%/with %> .Ve .IP "\s-1INCLUDE, INCLUDE_VAR\s0" 4 .IX Item "INCLUDE, INCLUDE_VAR" .Vb 2 \& <%include template.htc%> \& <%include_var param_with_template_name%> .Ve .IP "\s-1COMMENT, VERBATIM, NOPARSE\s0" 4 .IX Item "COMMENT, VERBATIM, NOPARSE" .Vb 4 \& <%comment explanation %> \& This will not appear in the rendered template. \& blah blah... \& <%/comment explanation %> .Ve .IP "\s-1SWITCH, CASE\s0" 4 .IX Item "SWITCH, CASE" .Vb 5 \& <%switch .config.language%> \& <%case de%>Hallo \& <%case es%>Hola \& <%case en,default%>Hello \& <%/switch .config.language%> .Ve .IP "\s-1PERL\s0" 4 .IX Item "PERL" See section Perl in HTML::Template::Compiled .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" Each attribute can be written as .PP .Vb 3 \& attribute=foo \& attribute="some thing" \& attribute=\*(Aqsome "thing"\*(Aq .Ve .IP "\s-1NAME\s0" 4 .IX Item "NAME" You can omit the \f(CW\*(Aqname=\*(Aq\fR here. .Sp .Vb 1 \& <%if var%>var<%elsif name=var2%>var4<%/if%> .Ve .Sp Can be used in all tags. .IP "\s-1ESCAPE\s0" 4 .IX Item "ESCAPE" .Vb 4 \& <%= message escape=html %> \& <%= params escape=url %> \& <%= params escape=js %> \& <%= some_var escape=dump|html%> .Ve .Sp Can be used in \f(CW\*(C`VAR\*(C'\fR\-tags. .IP "\s-1DEFAULT\s0" 4 .IX Item "DEFAULT" .Vb 1 \& <%= this.var.might_be_undef default="my fault" %> .Ve .Sp Can be used in \f(CW\*(C`VAR\*(C'\fR\-tags. .IP "\s-1ALIAS\s0" 4 .IX Item "ALIAS" .Vb 1 \& <%loop cds alias="cd" %><%= $cd.title %><%/loop cds %> .Ve .Sp Can be used in \f(CW\*(C`LOOP\*(C'\fR and \f(CW\*(C`WHILE\*(C'\fR. Works like \*(L"\s-1SET_VAR\*(R"\s0 and is short for .Sp .Vb 1 \& <%loop cds %><%set_var cd value=_ %><%= cd.title %><%/loop cds %> .Ve .Sp Useful for nested loops. .IP "\s-1SET_VAR\s0" 4 .IX Item "SET_VAR" .Vb 2 \& <%set_var myvar value=.another.var %> \& <%set_var myvar2 expr="60 * 60 * 24" %> .Ve .Sp This creates a variable similar to a package var with \fBlocal()\fR in perl. .IP "\s-1USE_VARS\s0" 4 .IX Item "USE_VARS" .Vb 3 \& \& <%use_vars myvar,myvar2 %> \& myvar: <%= myvar %> .Ve .IP "\s-1JOIN\s0" 4 .IX Item "JOIN" .Vb 1 \& <%loop cds join=", " %><%= _.title%><%/loop cds%> .Ve .Sp can be used in \f(CW\*(C`LOOP\*(C'\fR .IP "\s-1BREAK\s0" 4 .IX Item "BREAK" .Vb 3 \& <%loop cds break="3" %> \& <%= _.title%><%if _\|_break_\|_ %>\en \& <%/loop cds%> .Ve .Sp Sets \f(CW\*(C`_\|_break_\|_\*(C'\fR to 1 every xth loop. Can be used in \f(CW\*(C`LOOP\*(C'\fR, \f(CW\*(C`WHILE\*(C'\fR and \f(CW\*(C`EACH\*(C'\fR .SH "OPTIONS" .IX Header "OPTIONS" .IP "(loop)_context_vars" 4 .IX Item "(loop)_context_vars" .Vb 11 \& <%= _\|_index_\|_ %> the current loop index starting at 0 \& <%= _\|_counter_\|_ %> the current loop index starting at 1 \& <%= _\|_first_\|_ %> true if first iteration \& <%= _\|_last_\|_ %> true if last iteration \& <%= _\|_odd_\|_ %> true if _\|_counter_\|_ is odd \& <%= _\|_inner_\|_ %> true if not last or first iteration \& <%= _\|_key_\|_ %> the key of an EACH iteration \& <%= _\|_value_\|_ %> the value of an EACH iteration \& <%= _\|_break_\|_ %> see L<"BREAK"> above \& <%= _\|_filename_\|_ %> filename of current template (since 0.91_001) \& <%= _\|_filenameshort_\|_ %> short filename of current template (since 0.91_001) .Ve