Skip to content

Commit

Permalink
rewrite FillInForm example
Browse files Browse the repository at this point in the history
  • Loading branch information
gfx committed Sep 29, 2012
1 parent cf7e112 commit d8c7844
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 3 additions & 5 deletions example/fillinform.pl
@@ -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',
);

Expand Down
9 changes: 8 additions & 1 deletion lib/Text/Xslate/Manual/Cookbook.pod
Expand Up @@ -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
Expand Down

0 comments on commit d8c7844

Please sign in to comment.