html::template::compiled::classic(3pm) [debian man page]
HTML::Template::Compiled::Classic(3pm) User Contributed Perl Documentation HTML::Template::Compiled::Classic(3pm)NAME
HTML::Template::Compiled::Classic - Provide the classic functionality like HTML::Template
SYNOPSIS
use HTML::Template::Compiled::Classic compatible => 1;
my $htcc = HTML::Template::Compiled::Classic->new(
# usual parameters for HTML::Template::Compiled
);
DESCRIPTION
This class provides features which can not be used together with features from HTML::Template::Compiled. These are:
dots in TMPL_VARs
If you want to use
<TMPL_VAR NAME="some.var.with.dots">
you cannot use the dot-feature
<TMPL_VAR NAME="some.hash.keys">
at the same time.
Subref variables
In HTML::Template, the following works:
my $ht = HTML::Template->new(
scalarref => "<TMPL_VAR foo>",
);
$ht->param(foo => sub { return "bar" });
print $ht->output; # prints 'bar'
This doesn't work in HTML::Template::Compiled (in the past it did, but as of HTC version 0.70 it won't any more, sorry).
METHODS
compiler_class
returns HTML::Template::Compiled::Compiler::Classic
validate_var
gets the var name (parsed out of "NAME="foo.bar"" and returns if the string is a valid var name
perl v5.14.2 2012-05-26 HTML::Template::Compiled::Classic(3pm)
Check Out this Related Man Page
Template::Alloy::HTE(3pm) User Contributed Perl Documentation Template::Alloy::HTE(3pm)NAME
Template::Alloy::HTE - HTML::Template and HTML::Template::Expr roles.
DESCRIPTION
The Template::Alloy::HTE role provides syntax and interface support for the HTML::Template and HTML::Template::Expr modules.
Provides for extra or extended features that may not be as commonly used. This module should not normally be used by itself.
See the Template::Alloy documentation for configuration and other parameters.
HOW IS Template::Alloy DIFFERENT FROM HTML::Template
Alloy can use the same base template syntax and configuration items as HTE and HT. The internals of Alloy were written to support TT3, but
were general enough to be extended to support HTML::Template as well. The result is HTML::Template::Expr compatible syntax, with Alloy
speed and a wide range of additional features.
The TMPL_VAR, TMPL_IF, TMPL_ELSE, TMPL_UNLESS, TMPL_LOOP, and TMPL_INCLUDE all work identically to HTML::Template.
o Added support for other TT3 directives and for TT style "dot notation."
<TMPL_SET a = "bar">
<TMPL_SET b = [1 .. 25]>
<TMPL_SET foo = PROCESS 'filename.tt'>
<TMPL_GET foo> # similar to <TMPL_VAR NAME="foo">
<TMPL_GET b.3>
<TMPL_GET my.nested.chained.variable.1>
<TMPL_GET my_var | html>
<TMPL_USE foo = DBI(db => ...)>
<TMPL_CALL foo.connect>
Any of the TT directives can be used in HTML::Template documents.
For many die-hard HTML::Template fans, it is probably quite scary to be providing all of the TT functionality. All of the extended TT
functionality can be disabled by setting the NO_TT configuration item. The NO_TT configuration is automatically set if the SYNTAX is
set to "ht" and the output method is called.
o There is an ELSIF!!!
<TMPL_IF foo>
FOO
<TMPL_ELSIF bar>
BAR
<TMPL_ELSE>
Done then
</TMPL_IF>
o Added CHOMP capabilities (PRE_CHOMP and POST_CHOMP)
Foo
<~TMPL_VAR EXPR="1+2"~>
Bar
Prints Foo3Bar
o Added INTERPOLATE capability
<TMPL_SET foo = 'FOO'>
<TMPL_CONFIG INTERPOLATE => 1>
$foo <TMPL_GET foo> ${ 1 + 2 }
Prints
FOO FOO 3
o Allow for HTML::Template templates to include TT style templates.
<TMPL_CONFIG SYNTAX => 'tt3'>
<TMPL_INCLUDE "filename.tt">
o Allow for Expr parsing to follow proper precedence rules.
<TMPL_VAR EXPR="1 + 2 * 3">
Properly prints 7.
o Uses all of the caching and opcode tree optimations provided by Template::Alloy and Template::Alloy::XS.
o Alloy does not provide the query method from HTML::Template. This is because parsing of the document is delayed until the output
method is called, and because Alloy supports TT style chained variables which often are not resolvable until run time.
UNSUPPORTED HT CONFIGURATION
die_on_bad_params
Alloy does not resolve variables until the template is output.
force_untaint
strict
Alloy is strict on parsing HT documents.
shared_cache, double_cache
Alloy doesn't have shared caching. Yet.
search_path_on_include
Alloy will check the full path array on each include.
debug items
The HTML::Template style options are included here, but you can use the TT style DEBUG and DUMP directives to do intropection.
max_includes
Alloy uses TT's recursion protection.
filter
Alloy doesn't offer these.
ROLE METHODS
"register_function"
Defines a new function for later use as text vmethod or top level function.
"clear_param"
Empties the paramter list.
"query"
Not supported.
"new_file"
Creates a new object that will process the passed file.
$obj = Template::Alloy->new_file("my/file.hte");
"new_scalar_ref"
Creates a new object that will process the passed scalar ref.
$obj = Template::Alloy->new_scalar_ref("some template text");
"new_array_ref"
New object that will process the passed array (each item represents a line).
$obj = Template::Alloy->new_array_ref(@array);
"new_filehandle"
$obj = Template::Alloy->new_filehandle(*FH);
"parse_tree_hte"
Called by parse_tree when syntax is set to ht or hte. Parses for tags HTML::Template style.
"param"
See Template::Alloy.
"output"
See Template::Alloy.
AUTHOR
Paul Seamons <paul at seamons dot com>
LICENSE
This module may be distributed under the same terms as Perl itself.
perl v5.10.1 2011-01-26 Template::Alloy::HTE(3pm)