CGI::Ex::Template man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

CGI::Ex::Template(3)  User Contributed Perl Documentation CGI::Ex::Template(3)

NAME
       CGI::Ex::Template - Template::Alloy based TT2/TT3/HT/HTE/Tmpl/Velocity
       engine.

SYNOPSIS
   Template::Toolkit style usage
	   my $t = Template::Alloy->new(
	       INCLUDE_PATH => ['/path/to/templates'],
	   );

	   my $swap = {
	       key1 => 'val1',
	       key2 => 'val2',
	       code => sub { 42 },
	       hash => {a => 'b'},
	   };

	   # print to STDOUT
	   $t->process('my/template.tt', $swap)
	       || die $t->error;

	   # process into a variable
	   my $out = '';
	   $t->process('my/template.tt', $swap, \$out);

	   ### Alloy uses the same syntax and configuration as Template::Toolkit

   HTML::Template::Expr style usage
	   my $t = Template::Alloy->new(
	       filename => 'my/template.ht',
	       path	=> ['/path/to/templates'],
	   );

	   my $swap = {
	       key1 => 'val1',
	       key2 => 'val2',
	       code => sub { 42 },
	       hash => {a => 'b'},
	   };

	   $t->param($swap);

	   # print to STDOUT (errors die)
	   $t->output(print_to => \*STDOUT);

	   # process into a variable
	   my $out = $t->output;

	   ### Alloy can also use the same syntax and configuration as HTML::Template

   Text::Tmpl style usage
	   my $t = Template::Alloy->new;

	   my $swap = {
	       key1 => 'val1',
	       key2 => 'val2',
	       code => sub { 42 },
	       hash => {a => 'b'},
	   };

	   $t->set_delimiters('#[', ']#');
	   $t->set_strip(0);
	   $t->set_values($swap);
	   $t->set_dir('/path/to/templates');

	   my $out = $t->parse_file('my/template.tmpl');

	   my $str = "Foo #[echo $key1]# Bar";
	   my $out = $t->parse_string($str);

	   ### Alloy uses the same syntax and configuration as Text::Tmpl

   Velocity (VTL) style usage
	   my $t = Template::Alloy->new;

	   my $swap = {
	       key1 => 'val1',
	       key2 => 'val2',
	       code => sub { 42 },
	       hash => {a => 'b'},
	   };

	   my $out = $t->merge('my/template.vtl', $swap);

	   my $str = "#set($foo 1 + 3) ($foo) ($bar) ($!baz)";
	   my $out = $t->merge(\$str, $swap);

DESCRIPTION
       CGI::Ex::Template is the original base for the code that is now
       Template::Alloy.	 Template::Alloy employed enough complexity and
       featureset to warrant moving it out to a separate namespace.

       CGI::Ex::Template is now a place holder subclass of Template::Alloy.
       You can use CGI::Ex::Template as a standalone module - but it is
       suggested that you use Template::Alloy directly instead.

       For examples of usage, configuration, syntax, bugs, vmethods,
       directives, etc please refer to the Template::Alloy documentation.

LICENSE
       This module may be distributed under the same terms as Perl itself.

AUTHOR
       Paul Seamons <perl at seamons dot com>

perl v5.14.1			  2010-02-25		  CGI::Ex::Template(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net