########################################################################### # Copyright (c) Nate Wiger http://nateware.com. All Rights Reserved. # Please visit http://formbuilder.org for tutorials, support, and examples. ########################################################################### package CGI::FormBuilder::Template; =head1 NAME CGI::FormBuilder::Template - Template adapters for FormBuilder =head1 SYNOPSIS # Define a template engine package CGI::FormBuilder::Template::Whatever; use base 'Whatever::Template::Module'; sub new { my $self = shift; my $class = ref($self) || $self; my %opt = @_; # override some options $opt{some_setting} = 0; $opt{another_var} = 'Some Value'; # instantiate the template engine $opt{engine} = Whatever::Template::Module->new(%opt); return bless \%opt, $class; } sub render { my $self = shift; my $form = shift; # only arg is form object # grab any manually-set template params my %tmplvar = $form->tmpl_param; # example template manipulation my $html = $self->{engine}->do_template(%tmplvar); return $html; # scalar HTML is returned } =cut use strict; use warnings; no warnings 'uninitialized'; our $VERSION = '3.10'; warn __PACKAGE__, " is not a real module, please read the docs\n"; 1; __END__ =head1 DESCRIPTION This documentation describes the usage of B templates, as well as how to write your own template adapter. The template engines serve as adapters between CPAN template modules and B. A template engine is invoked by using the C