Skip Menu |

This queue is for tickets about the HTML-FormFu CPAN distribution.

Report information
The Basics
Id: 39065
Status: resolved
Priority: 0/
Queue: HTML-FormFu

People
Owner: Nobody in particular
Requestors: felix.ostmann [...] thewar.de
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: Add HTML::FormFu::Inflator::Callback
Just a simple Callback for Inflators :) Then all 5 are complete :)
Subject: Callback.pm
package HTML::FormFu::Inflator::Callback; use strict; use base 'HTML::FormFu::Inflator'; __PACKAGE__->mk_accessors(qw/ callback /); sub inflator { my ( $self, $value ) = @_; my $callback = $self->callback || sub {''}; no strict 'refs'; return $callback->($value); } 1; __END__ =head1 NAME HTML::FormFu::Inflator::Callback - Callback inflator =head1 SYNOPSIS $field->inflator('Callback')->callback( \&my_callback ); --- elements: - type: Text name: foo inflators: - type: Callback callback: "main::my_inflator" =head1 DESCRIPTION Callback inflator. =head1 METHODS =head2 callback Arguments: \&code-reference Arguments: "subroutine-name" =head1 SEE ALSO Is a sub-class of, and inherits methods from L<HTML::FormFu::Inflator> L<HTML::FormFu::FormFu> =head1 AUTHOR Carl Franks C<cfranks@cpan.org> =head1 LICENSE This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
From: Sadrak
There are also no deflator Callback ... On So. 07. Sep. 2008, 07:32:57, Sadrak wrote: Show quoted text
> Just a simple Callback for Inflators :) > > Then all 5 are complete :)
Thanks, I've added this to svn, and a Deflator::Callback too, with tests. Cheers, Carl