Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rewrite FillInForm example

  • Loading branch information...
commit d8c7844de994dff4763d8cf330a7b37a27e308fb 1 parent cf7e112
FUJI Goro (gfx) gfx authored
Showing with 11 additions and 6 deletions.
  1. +3 −5 example/fillinform.pl
  2. +8 −1 lib/Text/Xslate/Manual/Cookbook.pod
8 example/fillinform.pl
View
@@ -1,12 +1,10 @@
#!perl -w
use strict;
-use Text::Xslate qw(html_builder);
-use HTML::FillInForm::Lite 1.09 qw(fillinform);
+use Text::Xslate;
+use HTML::FillInForm::Lite 1.09;
my $tx = Text::Xslate->new(
- function => {
- fillinform => html_builder(\&fillinform),
- },
+ html_builder_module => [ 'HTML::FillInForm::Lite' => [qw(fillinform)] ],
cache_dir => '.eg_cache',
);
9 lib/Text/Xslate/Manual/Cookbook.pod
View
@@ -70,12 +70,19 @@ Output:
Because L<HTML::FillInForm::Lite> provides C<fillinform> function,
it becomes more simple:
- use HTML::FillInForm qw(fillinform);
+ use HTML::FillInForm::Lite qw(fillinform);
my $tx = Text::Xslate->new(
function => { fillinform => html_builder(\&fillinform) },
);
+From 1.5018 on, C<html_builder_module> are supported for HTML builder modules like C<HTML::FillInForm>. Just import HTML builder functions with C<html_builder_module> option.
+
+ my $tx = Text::Xslate->new(
+ html_builder_module => [ 'HTML::FillInForm::Lite' => [qw(fillinform)] ],
+ );
+
+
See also L<HTML::FillInForm> or L<HTML::FillInForm::Lite> for details.
=head3 Using HTML form builders
Please sign in to comment.
Something went wrong with that request. Please try again.